#!/bin/bash begin_of_html() { cat > "$1" < EOF } _OUTFILE="$2" _INFILE="$1" main() { begin_of_html "$_OUTFILE" /usr/bin/markdown "$_INFILE" >> "$_OUTFILE" echo "" >> "$_OUTFILE" } case $1 in --help|-h) echo "$0 file.md out.html" exit 0 ;; *) if [[ $# -ne 2 ]] then echo "Invalid arguments!" echo "$0 file.md out.html" else main fi exit 1 ;; esac