Skip to content

Instantly share code, notes, and snippets.

@rdyv
Last active June 3, 2019 20:24

Variable substitution

$\{var:-word}: If var is null or unset, word is substituted for var. The value of var does not change.

$\{var:=word}: If var is null or unset, var is set to the value of word.

$\{var:?message}: If var is null or unset, message is printed to standard error. This checks that variables are set correctly.

$\{var:+word}: If var is set, word is substituted for var. The value of var does not change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment