TIL: Bash Default Trick
How do you default a bash variable?
$ FOO=dingo
$ echo "$FOO"
dingo
$ BAR="${FOO:-somedefault}"
$ echo $BAR
dingo
$ BAR="${FOOD:-somedefault}"
$ echo $BAR
somedefault
And guess what.
$ BAR="${FOOD:-I can use spaces here.}"
$ echo $BAR
I can use spaces here.