From 54920103c2843f5a3620effbccaceaee7f6885c1 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 18 May 2019 00:07:32 -0400 Subject: scripts moved to ~/.local/bin --- .local/bin/tools/rotdir | 4 ++++ 1 file changed, 4 insertions(+) create mode 100755 .local/bin/tools/rotdir (limited to '.local/bin/tools/rotdir') diff --git a/.local/bin/tools/rotdir b/.local/bin/tools/rotdir new file mode 100755 index 0000000..e7103db --- /dev/null +++ b/.local/bin/tools/rotdir @@ -0,0 +1,4 @@ +#!/bin/sh +[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1 +base="$(basename $1)" + ls "$PWD" | awk "BEGIN { lines = \"\"; m = 0; } /^$base$/ { m = 1; } { if (!m) { if (lines) { lines = lines\"\n\"; } lines = lines\"\"\$0; } else { print \$0; } } END { print lines; }" -- cgit v1.3.1