Skip to content

Instantly share code, notes, and snippets.

@edunham
Created November 6, 2014 00:20
Show Gist options
  • Save edunham/41f40fdc9d4dabbe3826 to your computer and use it in GitHub Desktop.
Save edunham/41f40fdc9d4dabbe3826 to your computer and use it in GitHub Desktop.
#! /bin/bash
rm -f draft1.html;
cat pre.html >> draft1.html;
for f in {01..27};
do
echo "</pre><a name=\"$f\">" >> draft1.html;
echo "<h1>Chapter $f</h1></a><pre>" >> draft1.html;
tail -n+2 $f* | fold -s -w 80 | sed -e 's/</\&lt;/g' -e 's/>/\&gt;/g'>> draft1.html;
done
cat post.html >> draft1.html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment