[Gllug] Changing case on filenames

Simon Stewart sms at lateral.net
Mon Mar 4 19:08:08 UTC 2002


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

Will do the trick. Obviously you shoud edit the wildcard in the first
line to be something that's sane ( *.doc or something like that)

Cheers,

Simon

-- 
"It's a small world, but I wouldn't want to paint it..."
     Steven Wright

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




More information about the GLLUG mailing list