Reputation: 61
What does the following bash syntax mean?
MY_VAR=${MY_VAR:-"mystring"}
Thank you in advance.
Upvotes: 0
Views: 141
Reputation: 241758
See Parameter Expansion in man bash
:
${parameter:-word}
Use Default Values. If
parameter
is unset or null, the expansion ofword
is substituted. Otherwise, the value ofparameter
is substituted.
Upvotes: 3