zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Remind me why ${name+word} is the way it is?
Date: Fri, 11 Nov 2016 20:34:00 -0800	[thread overview]
Message-ID: <161111203400.ZM31567@torch.brasslantern.com> (raw)

Noodling with something else and ...

torch% name='foo[bar]'
torch% echo ${name}
foo[bar]
torch% echo ${name+foo[bar]}
zsh: no matches found: foo[bar]
torch% print -l ${name+foo bar}
foo bar

So the "word" in ${name+word} and variants is not subject to splitting,
but is subject to globbing, even though (w/o GLOB_SUBST SH_WORDSPLIT)
${name} is not subject to either of those.

I know it's always been that way and I'm sure I knew why at some point.


             reply	other threads:[~2016-11-12  4:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161112043435epcas1p1414be9386b843c435a1f1bc6cb242af1@epcas1p1.samsung.com>
2016-11-12  4:34 ` Bart Schaefer [this message]
2016-11-14  9:46   ` Peter Stephenson
2016-11-17  2:33   ` Han Pingtian
2016-11-17  5:34     ` Bart Schaefer
2016-11-23  1:26       ` Han Pingtian
2016-11-29  6:44         ` Spurious "no match" (Re: Remind me why ${name+word} is the way it is?) Bart Schaefer
2016-11-29  9:38           ` Peter Stephenson
2016-11-29 10:06             ` Peter Stephenson
2016-11-18  1:30     ` Remind me why ${name+word} is the way it is? Han Pingtian

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=161111203400.ZM31567@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@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).