From d0715267f8353db100e7cc55ef31a882505f1e1f Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Thu, 2 Dec 2021 23:31:48 +0100 Subject: [PATCH] bin: add line rewrite utility --- .local/bin/scripts/ex | 1 + .local/bin/scripts/rewrite | 3 +++ 2 files changed, 4 insertions(+) create mode 100755 .local/bin/scripts/rewrite diff --git a/.local/bin/scripts/ex b/.local/bin/scripts/ex index 9973b3d..52540e5 100755 --- a/.local/bin/scripts/ex +++ b/.local/bin/scripts/ex @@ -1,6 +1,7 @@ #!/bin/sh -e # ex - archive extractor # usage: ex +# depends: rewrite(in dotfiles) for arg do if test -r "$arg"; then path="$(realpath "$arg")" diff --git a/.local/bin/scripts/rewrite b/.local/bin/scripts/rewrite new file mode 100755 index 0000000..1b1c31e --- /dev/null +++ b/.local/bin/scripts/rewrite @@ -0,0 +1,3 @@ +#!/bin/sh +# Pipe a command into this and each output line will rewrite the previous one +sed --unbuffered '2,$s|^|\\e[1A\\e[K|' | xargs -d '\n' -L 1 echo -e