diff options
author | John Ankarström <john@ankarstrom.se> | 2021-01-06 21:24:51 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-01-06 21:24:51 +0100 |
commit | c01c37b8fc619346edcf885498e1083177d61ff0 (patch) | |
tree | 9d24b7f470300091e9fab8f60d7653d2e6e5bf3c | |
download | ef-c01c37b8fc619346edcf885498e1083177d61ff0.tar.gz |
Add `m' (move) filter
-rwxr-xr-x | bin/flt/m | 16 |
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" |