Answers for "if bash script check for null"

C#
13

bash if null or empty

if [ -z "$variable" ];
  then echo "$variable is null";
  else echo "$variable is not null";
fi
Posted by: Guest on April-19-2020
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