Answers for "if variable is not empty shell script"

C#
5

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
Posted by: Guest on April-12-2021
2

bash check if variable is empty

if [ -z "$var" ] #return true if $var is unset
Posted by: Guest on February-05-2021

Code answers related to "if variable is not empty shell script"

C# Answers by Framework

Browse Popular Code Answers by Language