On Mon, Nov 21, 2022, at 2:20 AM, Ulrich Windl wrote: > I think the bash manual page lacks some important detail of parameter > substitution, namely: > "Bash tests for a parameter that is unset or null. Omitting the colon > results in a test only for a parameter that is unset." > > (found in > https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html)
You omitted all of the relevant context. The full paragraph is: When not performing substring expansion, using the form [sic] described below (e.g., ':-'), Bash tests for a parameter that is unset or null. Omitting the colon results in a test only for a parameter that is unset. Put another way, if the colon is included, the operator tests for both _parameter_'s existence and that its value is not null; if the colon is omitted, the operator tests only for existence. The manual then goes on to describe the ${parameter:-word}, ${parameter:=word}, ${parameter:?word}, and ${parameter:+word} forms. These are what your excerpt is talking about. So what do you think is missing, exactly? -- vq