#! /bin/bash # Renumbers all JPEG files in a directory as # picture-1.jpg, picture-2.jpg, etc. # Gowtham, 16 September 2004 # # This makes a list of all JPEG files # Modify the extension to pick other type of images export JPEG_LIST=`find . -iname "*.jpg" | sort` export i=1 for x in $JPEG_LIST do if [ "$x" != "" ] then echo "Working on $x" cp $x picture-$i.jpg export i=`expr $i + 1` fi done