bin: add line rewrite utility

This commit is contained in:
xeruf 2021-12-02 23:31:48 +01:00
parent 0806d4e85f
commit d0715267f8
2 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#!/bin/sh -e
# ex - archive extractor
# usage: ex <file>
# depends: rewrite(in dotfiles)
for arg do
if test -r "$arg"; then
path="$(realpath "$arg")"

3
.local/bin/scripts/rewrite Executable file
View File

@ -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