* Todd Slater <[EMAIL PROTECTED]> [01-11-2003 23:55]: > On Sat, 11 Jan 2003 17:22:43 -0800 > You don't have to use the ls command, this will work for files with spaces > in the name and also accounts for differing case: > > for image in /path/to/directory/*.[Jj][Pp][Gg] > do > FCNT=`printf "%02d" $CNT` > echo "$image" $FCNT-$NAME$EXT > CNT=$(($CNT+1)) > done >
Now the problem becomes mv. When specifying a name that contains a space, mv interprets it as multiple files as well. A backslash needs to be added somehow so that mv knows it's a single file. ab\ cd.jpg ==> 01-pic.jpg -- Regards, Matt Florido
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com