From 9e84b309cd0807ff029660d2f42a2397334efb2b Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 27 Jul 2021 11:31:02 -0300 Subject: aux/: Stick to 80 columns --- aux/80-columns.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'aux/80-columns.sh') diff --git a/aux/80-columns.sh b/aux/80-columns.sh index 02a8e81..ae4660e 100755 --- a/aux/80-columns.sh +++ b/aux/80-columns.sh @@ -1,9 +1,12 @@ #!/bin/sh set -eu +# shellcheck disable=2068 for f in ${@:-$(cat -)}; do - sed 's/\t/ /g' "$f" | - awk -v FNAME="$f" 'length > 80 { - printf "%s:%s:%s\n", FNAME, NR, $0 - }' + 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 -- cgit v1.2.3