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

Documentation of colon in parameter expansion



Hello,

I was recently trying to look up the syntax for '${NAME-WORD}'.
A search for '${NAME:-WORD}' turns up information on that syntax,
but one must look several paragraphs down to see that '${NAME-WORD}'
is also allowed and has a distinct meaning.  The string '${NAME-WORD}'
never appears in the manual.  I foolishly assumed that this meant
that the syntax is undefined.

Since the manual can be expected to be used primarily as a reference
(I personally have not read it thru in years), it seems like my
behaviour is to be expected.  Per haps the manual should have
the string '${NAME-WORD}' immediately above or below the string
'${NAME:-WORD}', and a sentence along the lines of, 'See below about
the variant of this syntax without the colon.'

Similar naturally applies to '${NAME:+WORD}', '${NAME:=WORD}', &c. I
realise that this means a fair bit of duplication, so I only offer it
as a suggestion.

Love,

-- 
Miciah Masters <miciah.masters@xxxxxxxxx> / <mdm0304@xxxxxxx> /
<miciah@xxxxxxxxxxxxx>




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