Skip to content

Instantly share code, notes, and snippets.

@silasb
Created April 20, 2020 12:47
Show Gist options
  • Save silasb/0d8cbb44d467a41b474438ad250b7bee to your computer and use it in GitHub Desktop.
Save silasb/0d8cbb44d467a41b474438ad250b7bee to your computer and use it in GitHub Desktop.
D=hello
[[ -z "${D}" ]] && echo '$D is blank or is set' || echo '$D set' "$D"
$D set hello
unset D
[[ -z "${D}" ]] && echo '$D is blank or is set' || echo '$D set:' "$D"
$D is blank or is set
D=
[[ -z "${D}" ]] && echo '$D is blank or is set' || echo '$D set:' "$D"
$D is blank or is set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment