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

Re: question about parameter expansion



On 09/26/2015 11:57 AM, Dmitri Vereshchagin wrote:
* Mikael Magnusson <mikachu@xxxxxxxxx> [2015-09-26 21:34]:
Here's another variant, which may or may not be considered more
concise (it happens to be the exact same number of characters, but
uses fewer things, and probably doesn't work under ksh_arrays, but
then, what does, commas abounds),

bar=${${:-baz}[1,$+foo-1]}
Nice.  Seems like there is another alternative

bar=${${foo-baz}#$foo}

Where is this sort of thing discussed in the manual?
It is so often the case that I want to research something
but I don't know where to look. Getting the basic terminology
strait helps--I'd have thought the above was 'variable tests'
or something like that, not 'parameter expansion' cuz I take
parameter to refer to command arguments.  In any case looking
for 'parameter expansion' in the index is no help.  Getting
the overall grammatical terminology still eludes me.  'Variable'
doesn't exist in the index at all and so I run out of ideas.



Messages sorted by: Reverse Date, Date, Thread, Author