Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is this the Zsh way for doing this?



    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> } >     # At this point you might also want to clean wildcards and slashes
> } >     # out of $track_name, but that's up to you.  Your original doesn't.
> }     No, it doesn't because I didn't thought of it :( Thanks for
> } pointing. Could it be solved using the (q) flag or should I use ${//}
> } and substitute every dangerous character for a safe version?
> The substituion is necessary for slashes, because you can't even create a
> file with slashes in the name.

    Of course, I didn't think of it, but a song name may have any
character :( Well, that's simple using ${/\/|/} on the appropriate
parameter, or something like that.
 
> The (q) flag is _not_ necessary for other metacharacters when creating
> the file (the argument to "mv" is already double-quoted); the problem
> would be with manipulating the names later.  So doing either nothing or
> the substitution is appropriate in that case.

    Manipulating the names later is not a problem, since Zsh behaves
quite well quoting when completing, etc... The only problem could be
names starting with '-', but almost all Linux utilities admit '--' as
end-of-options separator. 

    Again, thanks for your useful advice :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/



Messages sorted by: Reverse Date, Date, Thread, Author