diff options
author | EuAndreh <eu@euandre.org> | 2021-09-03 20:39:10 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-09-03 20:39:10 -0300 |
commit | 51a9914dc8ec02b053a5594b7478b4d68a750672 (patch) | |
tree | 8b3143830dc5658f3848328facded29e4c6cb52c /aux/80-columns.sh | |
parent | WIP reactivate nixvps with Terraform and nixos-rebuild on Vultr (diff) | |
download | server-51a9914dc8ec02b053a5594b7478b4d68a750672.tar.gz server-51a9914dc8ec02b053a5594b7478b4d68a750672.tar.xz |
aux/: Update
Diffstat (limited to 'aux/80-columns.sh')
-rwxr-xr-x | aux/80-columns.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/aux/80-columns.sh b/aux/80-columns.sh new file mode 100755 index 0000000..ae4660e --- /dev/null +++ b/aux/80-columns.sh @@ -0,0 +1,12 @@ +#!/bin/sh +set -eu + +# shellcheck disable=2068 +for f in ${@:-$(cat -)}; do + if [ "$(file -i "$f" | cut -d' ' -f2 | cut -d/ -f1)" = 'text' ]; then + sed 's/\t/ /g' "$f" | + awk -v FNAME="$f" 'length > 80 { + printf "%s:%s:%s\n", FNAME, NR, $0 + }' + fi +done |