summaryrefslogtreecommitdiff
path: root/tac
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-07-19 13:47:40 -0400
committerJakob Kaivo <jkk@ung.org>2019-07-19 13:47:40 -0400
commit512def0747a237976b045175d271d41280de8b15 (patch)
tree7831251ada4b6da1e14e7050a8cb0a8d5f5d01e2 /tac
parentfdf655797bbff965d93beb7e51c025eb3fc20526 (diff)
on second thought, an AWK script is fine
Diffstat (limited to 'tac')
-rwxr-xr-xtac12
1 files changed, 12 insertions, 0 deletions
diff --git a/tac b/tac
new file mode 100755
index 0000000..d4261a7
--- /dev/null
+++ b/tac
@@ -0,0 +1,12 @@
+cat "$@" | awk "$(tail -n +3 $0)"
+exit $?
+
+{
+ lines[NR] = $0;
+}
+
+END {
+ for (i = NR; i > 0; i--) {
+ print lines[i]
+ }
+}