Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.