Category Archives: Bash

What is the difference when assigning a bash variable value with this syntax?

Sorry if this is something really simple or has already been asked, yet due to the nature of the question I cannot think of any search terms to put on search engines.

Lately I have seen some bash scripts that they assign variable values like this:

What is the difference from the most usual way of assigning a value like this:

You can look at

This provides a default value : MY_BASH_VAR keeps its value if defined otherwise, it takes the default “myvalue”