#!/bin/bash -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cat "${DIR}"/chapters/*.md > "${DIR}/temp.md" sed -e '//r temp.md' -e 'x;$G' template.html > index.html