about summary refs log tree commit diff stats
path: root/src/nolink.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/nolink.sh')
-rw-r--r--src/nolink.sh14
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
3unlinks=( $(grep -L '\[.*\]\[.*\]' *) )
4total_things=$(ls | wc -l)
5
6if [[ -n $1 && $1 == "-l" ]]; then
7 echo ${unlinks[@]} | tr ' ' '\n'
8else
9 echo "${unlinks[$((RANDOM %= $((${#unlinks[@]}))))]}"
10 echo "(${#unlinks[@]} of $total_things still to link.)"
11fi
12
13
14#[no link][]