Tugger the SLUGger!SLUG Mailing List Archives

[SLUG] Re: covert lowercase to uppercase.


> ls *.JPG | perl -ane 'chop; system("mv $_ " . lc($_));'

perl has its own file ops you know ;)

 ls *.JPG | perl -lne 'rename $_, lc;'

and the ls isn't really doing anything except passing through the shell's
expanded glob, so:

 perl -e 'rename $_, lc for @ARGV' *.JPG

same with sh:

 for f in *.JPG; do mv $f `echo $f | tr A-Z a-z`; done

 - Gus