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 23085
- From: Sebastian Gniazdowski <psprint@xxxxxxxxxxx>
- To: Peter Stephenson <p.stephenson@xxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Is outer quoting not needed (docs say "redundant")?
- Date: Sat, 13 Jan 2018 17:50:17 +0100
- In-reply-to: <20171213113408.1d7fb3db@pwslap01u.europe.root.pri>
- 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>
On 13 Dec 2017 at 12:34:08, Peter Stephenson (p.stephenson@xxxxxxxxxxx) wrote:
> On Wed, 13 Dec 2017 08:00:51 +0100
> Sebastian Gniazdowski wrote:
> > gitout=( "${(@f)"$( "${gitcmd[@]}" )"}" )
> >
> > Is it the same?
>
> It should be, because the count of braces doesn't go to zero between the
> first "${" and the last "}" (see the rules I summarised last time). So
> only the final double quote causes quoting to end.
Going this way, in following braces also don't go zero.. But maybe it's not a bug:
arr=( "${(@Q)${(z@):-"a b" c}}" )
print -rl -- "${(@)arr}"
a
b
c
arr=( "${(@Q)${(z@):-a\\ b c}}" )
print -rl -- "${(@)arr}"
a b
c
It would be an interesting case because inner quotes wouldn't be a no-op.
--
Sebastian Gniazdowski
psprint /at/ zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author