Here is the script I used:
Code: Select all
for orig_name in *.jpg ; do b=$(basename $orig_name) ; mv $orig_name $b".png" ; done
Example:
I had foo.jpg
I wanted to rename it to foo.png
Instead it renamed it to foo.jpg.png
What did I do wrong and why?
I'm not trying to get this script to work so much as I am trying to learn the reasons it didn't work so future ones will be better.