aboutsummaryrefslogtreecommitdiff
path: root/aux/80-columns.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-08-15 17:31:16 -0300
committerEuAndreh <eu@euandre.org>2021-08-15 17:31:16 -0300
commit651bb5b3fb3a9b36599e1891efb22efb4bf34c3f (patch)
treeefbe3f44dccff3ed8eea651fed57c4ca937c03e9 /aux/80-columns.sh
parent_articles/2020-11-07-diy-an-offline-bug-tracker-with-text-files-git-and-email... (diff)
downloadeuandre.org-651bb5b3fb3a9b36599e1891efb22efb4bf34c3f.tar.gz
euandre.org-651bb5b3fb3a9b36599e1891efb22efb4bf34c3f.tar.xz
aux/: Update
Diffstat (limited to '')
-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