Category: Bash

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

September 27, 2013 at 10:58 pmCategory:Bash

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 http://linux.die.net/man/1/bash

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