summaryrefslogtreecommitdiffstats
path: root/.scripts/tools
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-03-09 15:27:10 -0500
committerLuke Smith <luke@lukesmith.xyz>2019-03-09 15:27:10 -0500
commitbbe1acb1788fb7b53fcc970a7709d30b2c23dfba (patch)
tree096bea06447a15e0df65e07c5fca8786ee4bd22b /.scripts/tools
parentcca884b02e2cbf5634d6228f8fd5628d365e5bf9 (diff)
downloadeibhear-bbe1acb1788fb7b53fcc970a7709d30b2c23dfba.tar.gz
eibhear-bbe1acb1788fb7b53fcc970a7709d30b2c23dfba.tar.zst
eibhear-bbe1acb1788fb7b53fcc970a7709d30b2c23dfba.zip
rotdir
Diffstat (limited to '.scripts/tools')
-rwxr-xr-x.scripts/tools/rotdir3
1 files changed, 3 insertions, 0 deletions
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; }"