about summary refs log tree commit diff stats
path: root/trunk/common-titles.sh
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/common-titles.sh')
-rw-r--r--trunk/common-titles.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/trunk/common-titles.sh b/trunk/common-titles.sh new file mode 100644 index 0000000..9bc0de8 --- /dev/null +++ b/trunk/common-titles.sh
@@ -0,0 +1,21 @@
1#!/bin/bash
2
3outFile="$1";
4header="$2";
5shift 2;
6glob="$@";
7
8echo -n "Compiling ${outFile}...";
9cat "$header" > $outFile;
10
11for file in $glob; do
12 # Copy title to $outFile & link
13 title="$(grep '^title:' "$file" | cut -d' ' -f2- | sed 's/"//g')";
14 if (( $RANDOM % 13 == 0 )); then
15 echo -n "| ";
16 else
17 echo -n " ";
18 fi
19 echo "[$title](${file%.*}.html)" >> "$outFile";
20done
21echo "Done.";