* Array values and parameter expansion specs
@ 1996-07-24 1:52 Bart Schaefer
0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 1996-07-24 1:52 UTC (permalink / raw)
To: zsh-workers
There isn't much documentation in zshexpn.man concerning which of the SPEC
forms can be used with array expressions. For example, ${#NAME} describes
what happens if NAME is an array, and there are a few mentions of NAME[@],
but otherwise there's silence. The stuff in zshparam.man (and the "Array
parameters" section of zsh.info) is no more helpful.
Consider:
zsh% foo=(1 2 3)
zsh% echo ${foo[2]:+whee}
whee
zsh% echo ${foo[2]:-whee}
2
zsh% echo ${foo[2]:=whee}
zsh: closing brace expected
zsh%
What's the distinction?
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.nbn.com/people/lantern
New male in /home/schaefer:
>N 2 Justin William Schaefer Sat May 11 03:43 53/4040 "Happy Birthday"
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1996-07-24 1:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-07-24 1:52 Array values and parameter expansion specs Bart Schaefer
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).