Yes, it does - so you can match subfolders.
Not sure you got what I meant:Would rename 'test\one\three\one\fred.pdf' to 'test\dne\three\one\frd.pdf' ...
Given the Regex I used it looks like the groups were:
ie. The complete path was handled as a string instead of each component of the path, (directories and file), handled individually, (test, one, three, one, fred - each having the Regex performed against them).
If that's the way it's supposed to work then, no offence, it's going to be the strangest rename program I've ever seen and make working out the Regex a bit more complex, (although it would allow renaming dirs/files based on parent and/or sub-dirs).
Need more clarification.
Of course, it could of just been a complete fluke that I happened to create a directory structure and choose a Regex that would bring about this confusion ...
I don't know if you noticed but it was suggesting directory name changes even though I hadn't specified the -d parameter.
If they are a part of the path to a regular file, yes. You cannot rename a whole directory without a file in it though.
I could make the non-d call skip subfolders, but then -d would be the same thing as not using -r, or am I mistaken?
I think this is connected with the point above, is the full path handled as a string or are directories and files handled on their individual names?
ls * | sed -E 's/(.*)text(.*)to(.*)remove(.*)/mv & "$1$2$3$4"/' | sh
Would a recursive version be the equivalent of changing to the next sub-dir and performing the same command?