diff options
Diffstat (limited to 'trunk/hapaxlink.sh')
-rw-r--r-- | trunk/hapaxlink.sh | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/trunk/hapaxlink.sh b/trunk/hapaxlink.sh deleted file mode 100644 index 286c43d..0000000 --- a/trunk/hapaxlink.sh +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | file="$1"; | ||
4 | headFile="$2"; | ||
5 | shift 2; | ||
6 | glob="$@"; # *.hapax | ||
7 | |||
8 | tempFile="${RANDOM}.tmp" | ||
9 | |||
10 | echo -n "Linking \"$file\"" | ||
11 | # Begin | ||
12 | cat "$headFile" > "$tempFile"; | ||
13 | echo -n "." | ||
14 | # Link words to files they appear in | ||
15 | for word in `sort "$file"`; do | ||
16 | f=`grep -liwq "^$word$" $glob`; | ||
17 | link="`basename $f .hapax`.html" | ||
18 | echo "[$word]($link)" >> "$tempFile"; | ||
19 | echo -n "." | ||
20 | done | ||
21 | |||
22 | # Make the changes happen | ||
23 | rm "$file" | ||
24 | mv "$tempFile" "$file" | ||
25 | |||
26 | echo "Done." | ||