I would like to copy some files to a directory, rename files, but save the extension. Is this possible with a simple cp, using regular expression?
For instance:
cp ^myfile\.(.*) mydir/newname.$1
So I could copy the file, saving the extension, but renaming it. Is there a way to get consistent elements in a regular expression cpto use it in a team? If not, I will make a perl script, I think, or if you have another way ...
thank
source
share