aboutsummaryrefslogblamecommitdiff
path: root/aux/80-columns.sh
blob: ae4660ecf50fb488573b36a1e8cfe2986e244dbe (plain) (tree)
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