This recipe is motivated by a situation I find myself in pretty often. When collecting picture files from holidays, for example, from different friends and also different photo devices in one folder, the file endings often look different. Some JPEG files have a .jpg extension, some have .jpeg, and some others even have .JPEG.
Some people might prefer to homogenize all extensions. It would be useful to rename all files with a single command. At the same time, we could remove spaces ' ' and substitute them by underscores '_', for example.
In this recipe, we will implement such a tool and call it renamer. It will accept a range of input patterns and their substitutes like this:
$ renamer jpeg jpg JPEG jpg
In that case, renamer will iterate recursively through the current directory and search for the patterns jpeg and JPEG...