I want to extend a recent question which I have asked to remove french characters with a combination of find
and rename
:
Rename files and directories with French characters
Now I am facing some files and directories with a \
in their names which is not touched by the following command:
find . -depth -execdir rename -n '
utf8::decode$_ or die "cannot decode $_\n";
s{[^\w.\@+,#!?:&%~()\[\]/\\ -]}{?}gs;
utf8::encode$_;
' {} +
I tried to use \\
to target that name but it seems to be the incorrect way. The file naming I am talking about looks like that:
$ls
'Links '
$ls -1b
Links\ *WHITESPACE*
Those dir names are causing PHP Code to break. For example when trying to move a file inside a dir with that naming.
How can I enhance the given command to also target the described names?