Assigning Default Values to Shell Variables

You can use something called "bash parameter expansion" to accomplish this.

To get the assigned value, or default if it's missing:

# If variable not set or null, use default.
FOO="${VARIABLE:-default}"

Or to assign default to VARIABLE at the same time:

# If variable not set or null, set it to default.
FOO="${VARIABLE:=default}"