From 3b37989606c44902d90a3723e197d8c318a302bf Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 27 Mar 2015 13:47:42 -0700 Subject: Change verse lines '$' -> '^| ' --- trunk/first-lines.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 trunk/first-lines.sh (limited to 'trunk/first-lines.sh') 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 @@ +#!/bin/bash + +outFile=src/first-lines.txt + +echo "" > $outFile + +for file in src/*.txt; do + echo -n "Getting first line of $file .. " + endOfYAML=$(sed -n '/^\.\.\.$/=' "$file") + firstLineNumber=$((endOfYAML + 2)) + + echo "$file: " >> $outFile + echo " $(head -n $firstLineNumber "$file" | tail -n 1)" >> $outFile + + unset endOfYAML firstLineNumber + echo "Done." +done -- cgit 1.4.1-21-gabe81