David Stark
David Stark

Reputation: 61

Bash variable expansion syntax with braces

What does the following bash syntax mean?

MY_VAR=${MY_VAR:-"mystring"}

Thank you in advance.

Upvotes: 0

Views: 141

Answers (1)

choroba
choroba

Reputation: 241758

See Parameter Expansion in man bash:

${parameter:-word}

Use Default Values. If parameter is unset or null, the expansion of word is substituted. Otherwise, the value of parameter is substituted.

Upvotes: 3

Related Questions