#!/bin/bash function error() { echo "Error: $@" >&2 echo "Try '$0 -h' for usage" >&2 exit 1 } # Check that we have the right tools for PROG in convert do which $PROG &> /dev/null || \ error "Requires '$PROG'" done cd ~/web/inamidst.com/www/lights for filename in *.jpg *.png do convert -thumbnail '100' $filename \ ~/web/inamidst.com/www/lights/thumb/$filename done # [EOF]