#!/usr/bin/bash year=`date +%Y` files=$(find $HOME/Journal/$year -type f -iname "*$1*\.md") if [ -z ${BROWSER} ]; then echo "BROWSER unset, defaulting to Firefox" export BROWSER=firefox fi counter=0 for file in $files; do # echo $file mdtohtml $file $file.html $BROWSER $file.html counter=$((counter + 1)) if [ $counter -gt 4 ]; then echo "Aborting after 4 files." echo "The following files would have been processed..." echo $files exit 1 fi done