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

Michael B. Trausch mike at trausch.us
Mon Aug 27 22:11:52 EDT 2007


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature




More information about the Ale mailing list