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

Re: auto-quoting inside braces in arguments



On 2021-02-18 11:07 a.m., Bart Schaefer wrote:
On Thu, Feb 18, 2021 at 10:57 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
Given the deep desire of shells to strip and interpret quotes
You're still misinterpreting this.  It's pretty straightforward:
-- quotes are interpreted ONCE when the command line is processed.
-- the only time quotes are ever interpreted AGAIN is with "eval".

Stop "eval"-ing things and you'll stop having problems.
As I was saying, my whole zsh universe revolves around it.  Might have been
a mistake at the getgo.  Still, every problem has been solved one way or
another and it's me trying to make the shell do what it doesn't want to do
so if it isn't easy that's my problem.

If for some reason "eval" is absolutely necessary, THEN you need to
assess what quoting interpretation you WOULD have used if the
argument(s) to eval were the original command line, and re-apply those
quotes, which zsh makes possible with ${(q)...} or ${(qqq)...} or
whatever.

(q) gets close to my philosophical instinct of how the thing should work.  But if there was some way of providing a string with absolute protection then I could proceed naively -- the string is always going to be exactly as I typed it.  Nevermind
tho, my functions work 90% as close to my theoretical model as I could want.
Remaining issues are whiny not substantive.






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