bash parameter default value code example
Example 1: optional argument bash
VAR="${1:-default}"
Example 2: Setting default variable value in bash
FOO="${VARIABLE:=default}" # If variable not set or null, set it to default.
VAR="${1:-default}"
FOO="${VARIABLE:=default}" # If variable not set or null, set it to default.