#!/bin/sh CV_OPTS="-resize 50%" /bin/ls -1 *.jpg | grep -v "^thumb_" | while read IMG; do echo "convert ${CV_OPTS} ${IMG} thumb_${IMG}" done