jump to navigation

Move with wildcards December 30, 2010

Posted by maxmil in : bash , trackback

Just found problems with a directory of images that had some extensions in uppercase (JPG) and others in lowercase (jpg).

I wanted to move all the uppercase JPG to lowercase.

This is the script that did it:

for f in *.JPG
do
new=${f:0:${#f}-4}
mv $f ${new}.jpg
done

Comments»

no comments yet - be the first?