copy and rename series of files which differ in extension within the same directory using terminal
I have a series of files which differ in their extensions, eg apple.txt, apple.tpf, apple.jpg, apple.png
I'm able to copy and rename these with:
for file in * ; do cp $file ${file//apple/orange} ; done
such that the directory now contains apple.txt, apple.tpf, apple.jpg, apple.png, orange.txt, orange.tpf, orange.jpg, orange.png
But what I'd like to be able to do is take a series of files which differ in their extensions (the initial files won't always be apple.*) and easily generate a number of copies (will vary depending upon circumstance) with different file names, eg:
One time, apple.* to orange.*, as summarized above
Another time, car.* to bus.* and also to train.*
Another time, grass.* to tree.*, grass.* to shrub.*, grass.* to hay.*
Is there a way to set this up, accounting for the generality of the initial file name, allowing for selection of the copied file name(s), and allowing this to be easily executed without having to edit and re-enter
for file in * ; do cp $file ${file//apple/orange} ; done
for all necessary permutations?
Formerly on PC, I was able to easily do this with
copy apple.* orange.*
copy car.* bus.*
copy car.* train.*
etc.
Looking for the OSX equivalent.
Thanks in advance for any assistance offered.
MacBook Pro (2017 – 2020)