This might be the first time I used Assign Default Values, from bash(1):

${parameter:=word}
Assign Default Values. If parameter is unset or null, the expansion of word is assigned to parameter. The value of parameter is then substituted. Positional parameters and special parameters may not be assigned to in this way.

I used it for the following code:


: ${F:=/tmp/Arch_is_the_best.html}

The use of colon is what I learned a few years back, it muzzles the output of expansion. I need the environment variable $F to have a default if the user doesn’t assign one when runs the script, and this is where Assign Default Values comes in.

It’s different than assign positional parameters to variables with default values, that is Use Default Values:


VAR=${1:-foobar}

Since there is no output, no need of : to silence.