Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: auto-quoting inside braces in arguments
- X-seq: zsh-users 26536
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: "Zsh Users" <zsh-users@xxxxxxx>
- Subject: Re: auto-quoting inside braces in arguments
- Date: Thu, 18 Feb 2021 22:12:35 +0000
- Archived-at: <https://zsh.org/users/26536>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-02/3e34714d-d0f0-4b8b-9f2b-fdbc10c85854%40www.fastmail.com>
- 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>
Bart Schaefer wrote on Thu, 18 Feb 2021 19:07 +00:00:
> Stop "eval"-ing things and you'll stop having problems.
+1. You might still run into null elision, though.
> 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.
Hang on. Why would it matter which style of quotes would have been
used? Considering «eval "$foo${(q)bar}$baz"», normally $foo would be
constructed to end on inter-token whitespace, and then the number of q's
wouldn't matter, whether it's 1, 2, 3, 4, q+, or q-.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author