Created
May 4, 2016 16:47
-
-
Save thejandroman/ee76354b940a4c9908ff540fa54cb340 to your computer and use it in GitHub Desktop.
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-3.2$ echo $VAR | |
bash-3.2$ if [ -z $VAR ]; then echo ‘variable is unset’; fi | |
‘variable is unset’ | |
bash-3.2$ if [ ! -z $VAR ]; then echo ‘variable is set’; fi | |
bash-3.2$ VAR='' | |
bash-3.2$ if [ -z $VAR ]; then echo ‘variable is unset’; fi | |
‘variable is unset’ | |
bash-3.2$ if [ ! -z $VAR ]; then echo ‘variable is set’; fi | |
bash-3.2$ VAR='test' | |
bash-3.2$ if [ -z $VAR ]; then echo ‘variable is unset’; fi | |
bash-3.2$ if [ ! -z $VAR ]; then echo ‘variable is set’; fi | |
‘variable is set’ | |
bash-3.2$ unset VAR | |
bash-3.2$ if [ -z $VAR ]; then echo ‘variable is unset’; fi | |
‘variable is unset’ | |
bash-3.2$ if [ ! -z $VAR ]; then echo ‘variable is set’; fi | |
bash-3.2$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment