From bbe1acb1788fb7b53fcc970a7709d30b2c23dfba Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 9 Mar 2019 15:27:10 -0500 Subject: [PATCH] rotdir --- .scripts/tools/rotdir | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 .scripts/tools/rotdir diff --git a/.scripts/tools/rotdir b/.scripts/tools/rotdir new file mode 100755 index 0000000..50e1d84 --- /dev/null +++ b/.scripts/tools/rotdir @@ -0,0 +1,3 @@ +#!/bin/sh +# Give this script a filename argument. Returns PWD rotated with that file first. +ls "$PWD" | awk "BEGIN { lines = \"\"; m = 0; } /^$1$/ { m = 1; } { if (!m) { if (lines) { lines = lines\"\n\"; } lines = lines\"\"\$0; } else { print \$0; } } END { print lines; }"