CC: | m [...] qjym.de |
Subject: | [File::Rename] [feature request] filename-only operation |
I just wanted to do something like this:
find */ -somecriteria | rename s/^/_/
, that is, rename some files that are spread over different subfolders.
However, this didn't work, because `rename` operates on the whole path,
not just the filename, so it tried to rename `dir/some/file` to
`_dir/some/file` (which failed) instead of `dir/some/_file` as I expected.
While there may be use cases for this whole-path operation, I assume a
filename-only mode is also quite useful in some cases. Thus, I suggest
to add an option, `--filename` or so, that makes the replacement only
change the filename part of the path. It could be used as follows:
rename --filename s/^/img_/ */*.jpeg
or
find -mtime +365 | rename --filename s/^foo_/old_foo_/
etc.