summaryrefslogtreecommitdiff
path: root/bin/flt
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-01-06 21:24:51 +0100
committerJohn Ankarström <john@ankarstrom.se>2021-01-06 21:24:51 +0100
commitc01c37b8fc619346edcf885498e1083177d61ff0 (patch)
tree9d24b7f470300091e9fab8f60d7653d2e6e5bf3c /bin/flt
downloadef-c01c37b8fc619346edcf885498e1083177d61ff0.tar.gz
Add `m' (move) filter
Diffstat (limited to 'bin/flt')
-rwxr-xr-xbin/flt/m16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/flt/m b/bin/flt/m
new file mode 100755
index 0000000..9611cd1
--- /dev/null
+++ b/bin/flt/m
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# m -- switch first and last line (move)
+
+read first
+mid=
+last=
+while read line; do
+ mid="$mid$last"
+ last="
+$line"
+done
+echo "$last" | tr -d '
+'
+echo "$mid"
+echo "$first"