[wellylug] Getting rid of illegal characters in filenames

jumbophut jumbophut at gmail.com
Tue Nov 23 17:19:19 NZDT 2004


On Tue, 23 Nov 2004 16:25:32 +1300 (NZDT), andrej at paradise.net.nz wrote:
> mv --backup t $i $(echo $i | tr '*$%' 'xyz');
> 

That will teach me not to read the man page.   :-)  

Having now read it, I see it will also be necessary to set the options
to --backup=existing to avoid overwriting a pre-existing backup.  I
presume that with that option, if you have my%file.doc and there is a
pre-existing myzfile.doc, ~myzfile.doc will be created.  If
~myzfile.doc already exists, ~myzfile.doc.1 will be created.  If that
already exists, ~myzfile.doc.2 will be created... The numbering of
backups has the unfortunate effect of changing the extension, which is
more of a problem for Windows than Linux.

[Head explodes]

(Oh, and somehow the filenames from the find command will need to be
quoted, as will $i, in case names contains spaces/other special
chars).

-- 
Tony (echo 'spend!,pocket awide' | sed 'y/acdeikospntw!, /l at omcgtjuba.phi/')




More information about the wellylug mailing list