#! /bin/bash projPath='/var/www/d/proj' for mdPath in $(find /var/lib/darcs -name 'README.md') do projName=$(basename $(dirname $mdPath)) htmlPath="${projPath}/${projName}.html" echo "$mdPath -> $htmlPath" pandoc -s -o $htmlPath $mdPath chmod 644 $htmlPath done