[ale] script or app to set all files to lower case

James Taylor James.Taylor at eastcobbgroup.com
Mon Aug 27 22:23:07 EDT 2007


That worked a little better.
It renamed all the files and folders at the immediate level, but had problems recursing.

The following is an example of the errors generated.

mv: cannot move `./SNAPINS/NWCADM32.DLL' to `./snapins/nwcadm32.dll': No such file or directory

It looks a little like it's enumerating the file list, and once the directory has been renamed, it can't find it to write the new file name to.

-jt



James Taylor
The East Cobb Group, Inc.
678-697-9420
james.taylor at eastcobbgroup.com
http://www.eastcobbgroup.com












>>> "Michael B. Trausch" <mike at trausch.us> 08/27/07 10:11 PM >>> 
Michael B. Trausch, on 08/27/2007 10:09 PM said:
> James Taylor, on 08/27/2007 10:04 PM said:
>> It's an iSCSI NSS (Novell Storage System) mounted directly on an OES Linux server.
>> Essentially a customized SLES9 server with NSS file system drivers.
>>
>> I forgot to mention that I have a folder depth of at least 20.
>>
> 
> Oh.
> 
> Mine is out; you'll need a for loop to run at least that many times.
> 
> You could do:
> 
> for i in `seq 1 30`; do
> find . | while read OldName; do
> NewName=`echo $OldName|tr [A-Z] [a-z]`
> mv -v "$OldName" "$NewName"
> done
> done
> 
> You might want to get rid of the -v on mv though, or redirect output to
> a file.
> 
> -- Mike
> 

Actually, better solution.  "-depth" makes it reverse order:

find . -depth | while read OldName; do
NewName=`echo $OldName|tr [A-Z] [a-z]`
mv -v "$OldName" "$NewName"
done


-- 
Michael B. Trausch               Internet Mail & Jabber: mike at trausch.us
Phone:  (404) 592-5746 x1                         http://www.trausch.us/
Mobile: (678) 522-7934             VoIP: 6453 at sip.trausch.us, 861384 at fwd
Pidgin 2.1.1 and plugins for Ubuntu Feisty! http://www.trausch.us/pidgin





More information about the Ale mailing list