Skip to content

Instantly share code, notes, and snippets.

@j33ty
Last active June 3, 2019 20:24
Show Gist options
  • Save j33ty/25c7fba4c9ec6a9969f4b6e3f61ef9cd to your computer and use it in GitHub Desktop.
Save j33ty/25c7fba4c9ec6a9969f4b6e3f61ef9cd to your computer and use it in GitHub Desktop.

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