On Sun, 12 Jan 2003 09:26:13 -0800 Matt Florido <[EMAIL PROTECTED]> wrote:
> * 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 Are you using bash or another shell? On my system (using bash) it works fine. Be sure you leave the quotes around "$image". Todd
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com