aboutsummaryrefslogtreecommitdiff
path: root/aux/80-columns.sh
diff options
context:
space:
mode:
Diffstat (limited to 'aux/80-columns.sh')
-rwxr-xr-xaux/80-columns.sh11
1 files changed, 7 insertions, 4 deletions
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