Batch rename file extensions on linux / OS X

Here is a small script to to batch rename file extensions.