about summary refs log tree commit diff stats
path: root/trunk/common-titles.sh
diff options
context:
space:
mode:
authorCase Duckworth2015-04-02 17:34:26 -0700
committerCase Duckworth2015-04-02 17:34:26 -0700
commitbd9abbe4eb94b9c77865bd28bf73ec6eb0b39a95 (patch)
treeebfeb8135d5610aac69b8938d4dab09b23b758e2 /trunk/common-titles.sh
parentRefactor makefile; Add hapax preprocessor (diff)
downloadautocento-bd9abbe4eb94b9c77865bd28bf73ec6eb0b39a95.tar.gz
autocento-bd9abbe4eb94b9c77865bd28bf73ec6eb0b39a95.zip
Fix #15: add compile support for indeces
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.";