From 3bceeb4da5ec953309bbc3e61d04f078198966d2 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 27 Jul 2021 12:51:36 -0300 Subject: aux/: Update, adjust Makefile --- aux/80-columns.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 aux/80-columns.sh (limited to 'aux/80-columns.sh') 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 -- cgit v1.2.3