Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Remind me why ${name+word} is the way it is?
- X-seq: zsh-workers 39923
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Remind me why ${name+word} is the way it is?
- Date: Fri, 11 Nov 2016 20:34:00 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:to:subject:mime-version; bh=HsFMhhXdoSQAeA2L/nNfJ7h39xH1AkCXwoKSxJf5I1Q=; b=krh6Kg3ZVtnB68qcyEVPUmX2PgXYr5PTq0xsaMPz/TLERiYEospJKykEGgjwrqL+uV tOkmzXktcuK5S50rYB72/O2aoYrx7rTt8/Zf26cxsjtBAelXnIoXywxIhcx4JUB1MbTs MgPhwddR3YpLby9vcnFNI5RPGuD8JDYKbdG96eakTQE5qtT1GILcZJqSkm1hClQfycyE 45MbYyJ2GHa7vi5pypAuO0BV/vcFodABZBzusVBtH8lySyLULXBS/yZS/1GXK76TEdb4 kvTn3HpB1oZnyJGezkHelPLtTXKPHT9Wbkh+CaLd1LKhXagVShPESRb0dtq9/ZoZbX9p WI/g==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author