From c01c37b8fc619346edcf885498e1083177d61ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 6 Jan 2021 21:24:51 +0100 Subject: Add `m' (move) filter --- bin/flt/m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bin/flt/m (limited to 'bin/flt/m') 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" -- cgit v1.2.3