Answers for "bash if variable not null"

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
0

check if a variable is null in bash

if [[ -n "$list_Data" ]]
then
    echo "not Empty"
else
    echo "empty"
fi
Posted by: Guest on March-20-2021

C# Answers by Framework

Browse Popular Code Answers by Language