#!/bin/bash for dir in $(ls .md) do for file in $(find .md/$dir) do if [[ "$file" == *.md ]] then newfile=$(sed "s/\.md\///; s/md/html/" <<< $file) echo "Saved "$file" to "$newfile pandoc -f markdown-smart $file -t html -o $newfile fi done done