Created
November 20, 2013 08:42
-
-
Save solidsnack/7559844 to your computer and use it in GitHub Desktop.
Demo of ${_+} predicate in Bash.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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