Bash Substitutions

Bash supports various constructs for substituting contents of variables.

Setting default values:

Substituting substring:

Command substitutions:

The latter is easier to nest: