0

What does the following bash syntax mean?

MY_VAR=${MY_VAR:-"mystring"}

Thank you in advance.

aymeric
  • 3,877
  • 2
  • 28
  • 42
David Stark
  • 61
  • 1
  • 4

1 Answers1

3

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.

choroba
  • 231,213
  • 25
  • 204
  • 289