Using bash, how I can batch rename a large number of files, where I need to construct a new name for each file, based on its existing name and a 'contextual map' - don't know what else to call it – of name fragments.
I have a lot of files in like this:
001.jpg 003.jpg 004.jpg 007.jpg ...
and a map like this:
001,white 003,grey 004,red 007,green ...
And now I want to rename all files, so that 001.jpg becomes 001-white.jpg etc..
How can I do this?