Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Remind me why ${name+word} is the way it is?



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