From: Sebastian Gniazdowski <psprint@zdharma.org>
To: Peter Stephenson <p.stephenson@samsung.com>,
Zsh Users <zsh-users@zsh.org>
Subject: Re: Is outer quoting not needed (docs say "redundant")?
Date: Sat, 13 Jan 2018 17:50:17 +0100 [thread overview]
Message-ID: <etPan.5a5a38c9.3e73a4c4.14e5a@zdharma.org> (raw)
In-Reply-To: <20171213113408.1d7fb3db@pwslap01u.europe.root.pri>
On 13 Dec 2017 at 12:34:08, Peter Stephenson (p.stephenson@samsung.com) 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
next prev parent reply other threads:[~2018-01-13 16:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20171212135535epcas4p2456a2aed9c9be07c9d461acb602b71e9@epcas4p2.samsung.com>
2017-12-12 13:41 ` Sebastian Gniazdowski
2017-12-12 15:00 ` Peter Stephenson
2017-12-13 7:00 ` Sebastian Gniazdowski
2017-12-13 11:34 ` Peter Stephenson
2018-01-13 16:50 ` Sebastian Gniazdowski [this message]
2018-01-13 17:36 ` Bart Schaefer
[not found] ` <etPan.5a5a45ec.3309bd20.14e5a@AirmailxGenerated.am>
2018-01-14 4:03 ` Sebastian Gniazdowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=etPan.5a5a38c9.3e73a4c4.14e5a@zdharma.org \
--to=psprint@zdharma.org \
--cc=p.stephenson@samsung.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).