diff options
Diffstat (limited to 'src/nolink.sh')
-rw-r--r-- | src/nolink.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/nolink.sh b/src/nolink.sh new file mode 100644 index 0000000..b4d6c3e --- /dev/null +++ b/src/nolink.sh | |||
@@ -0,0 +1,14 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | unlinks=( $(grep -L '\[.*\]\[.*\]' *) ) | ||
4 | total_things=$(ls | wc -l) | ||
5 | |||
6 | if [[ -n $1 && $1 == "-l" ]]; then | ||
7 | echo ${unlinks[@]} | tr ' ' '\n' | ||
8 | else | ||
9 | echo "${unlinks[$((RANDOM %= $((${#unlinks[@]}))))]}" | ||
10 | echo "(${#unlinks[@]} of $total_things still to link.)" | ||
11 | fi | ||
12 | |||
13 | |||
14 | #[no link][] | ||