This one was fun to do particularly because it helped to drum this stuff into my head.

I find myself using the suffix removal trick quite often. For example, today I typed the following one-liner to make ImageMagick convert some JPEG files to PNG and reduce them to a more manageable size:

for f in P*.JPG; do convert $f -resize 640 ${f%.JPG}.png; done

Glad you found it useful.