Yes, I ended up using for f in `find . *` do LC=`echo $f | tr 'A-Z' 'a-z' mv $f $LC done
This caused problems when the file was already lowercase & seemed to cause problems when renaming a directory. It looked like after a directory rename, ie ./FOO -> ./foo Find was still finding the capitalised version, so the operation ./FOO/blah -> ./foo/blah Was failing. No big deal though, just ran it a few times & since mv fails on a same-name move I ignored the errors. Cheers Brad > -----Original Message----- > From: Jim Cheetham [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 13 August 2003 12:57 p.m. > To: [EMAIL PROTECTED] > Subject: Re: Script help - upper to lower case filenames > > > On Wed, 2003-08-13 at 12:39, Christopher Sawtell wrote: > > for f in `ls` > > do > > LC_FILENAME=`echo $f | tr 'A-Z' 'a-z'` > > mv $f $LC_FILENAME > > done > > A very minor nitpick would be potential name collision, in > case there already existed a lower-case-named file with the > same 'name' as an uppercase example. > > The owner of the files should probably know the naming > standards used, and be "sure" that there isn't a problem in advance. > > This is a good reason for not distributing shell commands as > "programs" > - people expect much more error checking from a program! > > Oh, and this also isn't recursive ... 'find' might be OK, but > remembering the damn syntax for find's > 'invoke-an-executable-on-the-found-file' always takes me > longer than scripting something ... > > >
