in reply to rename 0.2 - an improved version of the script which comes with Perl
Just one squib about your choice of semantics for the "-z" option: downcasing names is already pretty easy (in fact, I assume you can specify it separately, while still using "-z"). But something that's not so easy, and that comes up all too often, is whole bunches of file names that happen to include characters like [<>|!=\&\$\#\(\)\[\]\{\}\\] (probably others as well), which tend to have special meanings in shell commands. When the unwitting shell user happens to do a quick "copy/paste" of such a name onto a command line, all hell breaks loose.
(I've seen file names like this created by "wget -r ..." as well as by "innovative" windows users putting files with "helpful" names onto volumes that are used by both samba and nfs.)
So, since there's already a way to downcase, but removing shell metacharacters can be an important issue in "sanitizing", how about the thrice-used "-z" handling the latter instead? (Note that a space really just another shell metacharacter -- so it makes sense to handle other such characters with the same option.)
(BTW, does "thrice used" mean "-zzz" or "-z -z -z"? I guess with the longer args it's an easier guess: "--sanitize --sanitize --sanitize", but that's a lot to put on the command line...)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: rename - an improved version of the script which comes with Perl
by Aristotle (Chancellor) on Oct 26, 2003 at 13:12 UTC |