On 04.09.2012 13:13, Roman Rakus wrote:
Hi,
Petr, adding to cc: list, found behaviour not documented, neither in man
page nor bash ref manual:
${par-word} will do expansion of par, and if the par is unset it is
substituted by word. It is different from ${par:-word}, where word is
used when par is unset or null.

Is it undocumented and deprecated, like $[]? Or just undocumented?

Hi Roman,

it actually is documented (and it's more general, not limited to "-")

[...]
When not performing substring expansion, using the forms documented below, bash tests for a parameter that is unset or null. Omitting the colon results in a test only for a parameter that is unset.
[...]

--
Be conservative in what you do, be liberal in what you accept from others.
- jbp, master of the net, in RFC793


Reply via email to