Skip to content

Instantly share code, notes, and snippets.

@solidsnack
Created November 20, 2013 08:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save solidsnack/7559844 to your computer and use it in GitHub Desktop.
Save solidsnack/7559844 to your computer and use it in GitHub Desktop.
Demo of ${_+} predicate in Bash.
bash -c '[[ ${1+isset} ]] ; echo "#? $?" ; echo "#1 $1"' bash
#? 1
#1
bash -c '[[ ${1+isset} ]] ; echo "#? $?" ; echo "#1 $1"' bash x
#? 0
#1 x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment