Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: auto-quoting inside braces in arguments
- X-seq: zsh-users 26535
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: auto-quoting inside braces in arguments
- Date: Thu, 18 Feb 2021 13:49:28 -0800
- Archived-at: <https://zsh.org/users/26535>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-02/e5117231-48d4-3615-728b-b291483b27c8%40eastlink.ca>
- In-reply-to: <CAH+w=7b8y3ZJ3U29HYdHoUQvwxGsqzkUmfJdLhK+vvr+mX_4fg@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <20210218134039.GA1492462@zira.vinc17.org> <8b3a9f93-5eb4-4d4d-8312-58c371e12239@www.fastmail.com> <CAH+w=7ZD5oFJitNmVSQbRuiY+OoY4_KaEYGXZ3JwA4dD=bAGdw@mail.gmail.com> <fedfc25e-116a-4abe-4778-c8578462124e@eastlink.ca> <CAH+w=7b8y3ZJ3U29HYdHoUQvwxGsqzkUmfJdLhK+vvr+mX_4fg@mail.gmail.com>
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