aboutsummaryrefslogtreecommitdiff
path: root/aux/80-columns.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-07-27 12:51:36 -0300
committerEuAndreh <eu@euandre.org>2021-07-27 12:51:36 -0300
commit3bceeb4da5ec953309bbc3e61d04f078198966d2 (patch)
treec30ba0fd9485a88f45bdd91d3784630f9e9fa950 /aux/80-columns.sh
parentTODOs.md: Dump links on Scratch (diff)
downloadgistatic-3bceeb4da5ec953309bbc3e61d04f078198966d2.tar.gz
gistatic-3bceeb4da5ec953309bbc3e61d04f078198966d2.tar.xz
aux/: Update, adjust Makefile
Diffstat (limited to 'aux/80-columns.sh')
-rwxr-xr-xaux/80-columns.sh12
1 files changed, 12 insertions, 0 deletions
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