Question

What does the following bash syntax mean?

MY_VAR=${MY_VAR:-"mystring"}

Thank you in advance.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top