I can't think of a way to copy and rename in one step. Perhaps others can.
If you don't have any commas in the file names, you could try parsing the output of
rename into a file and then running that file as a script. The
rename utility can use multile Perl expressions, so here are two. One is to do the renaming of the file, the other is to modify the directory. Adjust as needed. Perl is used to modify the output instead of
sed because there is no equivalent to non-greedy matching in
sed:
Code:
rename -n -v 's/old/new/; s|^|/path/to/destination/|;' * \
| perl -p -e 's/^.*?\(/cp -p /; s/, / /; s/\)$//;' \
> ren
nano ren
. ren
Otherwise, you'll probably have to just manually enumerate the files into a script and then edit that script by hand to do what you want.