voidrice/.scripts/tools/rotdir
Luke Smith bbe1acb178 rotdir
2019-03-09 15:27:10 -05:00

3 lines
274 B
Bash
Executable file

#!/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; }"