Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is outer quoting not needed (docs say "redundant")?
- X-seq: zsh-users 23087
- From: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Is outer quoting not needed (docs say "redundant")?
- Date: Sun, 14 Jan 2018 05:03:41 +0100
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <etPan.5a5a45ec.3309bd20.14e5a@AirmailxGenerated.am>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20171212135535epcas4p2456a2aed9c9be07c9d461acb602b71e9@epcas4p2.samsung.com> <etPan.5a2fdc87.88f1eab.c73c@zdharma.org> <20171212150024.13a1e78b@pwslap01u.europe.root.pri> <etPan.5a30d023.6d8c1390.c73c@zdharma.org> <20171213113408.1d7fb3db@pwslap01u.europe.root.pri> <etPan.5a5a38c9.3e73a4c4.14e5a@zdharma.org> <etPan.5a5a45ec.3309bd20.14e5a@AirmailxGenerated.am>
On 13 Jan 2018 at 18:36:39, Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) wrote:
> These are not the same. Because of the way backslashes behave when
> they follow the :- operator plus the effect of the (z) flag, the
> latter is actually the same as
>
> arr=( "${(@Q)${(z@):-"a\ b" c}}" )
>
> You can see this if you examine the inner expansion in isolation:
>
> % print -rl ${(z@):-"a b" c}
> a
> b
> c
> % print -rl ${(z@):-a\\ b c}
> a\ b
> c
>
Thanks. The point about "a\ b" shows that quotes are indeed active. However for final output, it's like " is being merged into quasi-quotes that are between :- and }.
--
Sebastian Gniazdowski
psprint /at/ zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author