Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

bash if variable is not empty

VAR=`echo Hello world`
if [[ -n "$VAR" ]] ; then echo "Variable is set"  ; fi
if [[ -z "$VAR" ]] ; then echo "Variable is null" ; fi
 
PREVIOUS NEXT
Tagged: #bash #variable #empty
ADD COMMENT
Topic
Name
4+6 =