#! /bin/sh DIRNAME=`pwd` DIRNAME=`basename $DIRNAME` cat >index.html < $DIRNAME

$DIRNAME

EOF for file in *; do [ "$file" = "index.html" ] && continue BASE=`basename "$file" | sed 's/\.[^.]*$//'` convert -scale 250x250 "${file}" "${BASE}.mini.jpeg" echo '' >>index.html done cat >>index.html < EOF