diff options
author | Case Duckworth | 2015-03-27 13:47:42 -0700 |
---|---|---|
committer | Case Duckworth | 2015-03-27 13:47:42 -0700 |
commit | 3b37989606c44902d90a3723e197d8c318a302bf (patch) | |
tree | e614c3ddbb8879e96ee739a75ad2f52a645b87c2 /trunk/first-lines.sh | |
parent | Add HAPAX LEGOMENA support & flatten structure (diff) | |
download | autocento-3b37989606c44902d90a3723e197d8c318a302bf.tar.gz autocento-3b37989606c44902d90a3723e197d8c318a302bf.zip |
Change verse lines '$' -> '^| '
Diffstat (limited to 'trunk/first-lines.sh')
-rw-r--r-- | trunk/first-lines.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/trunk/first-lines.sh b/trunk/first-lines.sh new file mode 100644 index 0000000..50b0e0c --- /dev/null +++ b/trunk/first-lines.sh | |||
@@ -0,0 +1,17 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | outFile=src/first-lines.txt | ||
4 | |||
5 | echo "" > $outFile | ||
6 | |||
7 | for file in src/*.txt; do | ||
8 | echo -n "Getting first line of $file .. " | ||
9 | endOfYAML=$(sed -n '/^\.\.\.$/=' "$file") | ||
10 | firstLineNumber=$((endOfYAML + 2)) | ||
11 | |||
12 | echo "$file: " >> $outFile | ||
13 | echo " $(head -n $firstLineNumber "$file" | tail -n 1)" >> $outFile | ||
14 | |||
15 | unset endOfYAML firstLineNumber | ||
16 | echo "Done." | ||
17 | done | ||