#! /bin/sh while IFS=: read field value; do case "$field" in "") break ;; Title) # echo strips leading and trailing whitespace title=${value# } ;; esac done tmpl=$(dirname $0) printf '\n' printf '\n' sed "s~TITLE~$title~" $tmpl/head.tmpl printf "

%s

\n" "$title" markdown cat $tmpl/foot.tmpl printf '\n'