More funny lf things

This commit is contained in:
2024-01-14 17:45:32 +01:00
parent e721a014b6
commit 6f6a59457c
4 changed files with 9 additions and 6 deletions
+3
View File
@@ -0,0 +1,3 @@
[ -z "$1" ] && echo "usage: rotdir regex 2>&1" && exit 1
base="$(basename "$1")"
ls "$PWD" | awk -v BASE="$base" 'BEGIN { lines = ""; m = 0; } { if ($0 == BASE) { m = 1; } } { if (!m) { if (lines) { lines = lines"\n"; } lines = lines""$0; } else { print $0; } } END { print lines; }'