1 2 3 4 5 6 7 8 9 10 11 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