[Gllug] Changing case on filenames

Mike Brodbelt mike at coruscant.demon.co.uk
Mon Mar 4 20:46:48 UTC 2002


On Mon, 2002-03-04 at 19:08, Simon Stewart wrote:
> On Mon, Mar 04, 2002 at 06:41:09PM +0000, Dylan Brewis wrote:
> > Hi guys
> > 
> > I've got about 1000 files copied from W9x which are variously in upper and 
> > lower case. Is there an easy way to get them all lower case (shell scripts or 
> > similar.) I've read thru the bash docs but to be honest they don't make much 
> > sense!
> 
> for file_name in *
> do
>   cp $file_name `echo $file_name | tr '[A-Z]' '[a-z]'`
> done

This wonderful technique can be built on:-

for i in *; do
mv $i `echo $i | tr 'A-Z' 'n-za-m'`
done

Which will lowercase and rot13 your filenames simultaneously.

Mike.

(I'm sorry, I couldn't help myself).


-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list