Answers for "if not null bash script"

C#
14

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
1

bash if not

if ! [ $(cat /etc/passwd | grep "sysa") ]; then
        echo "ERROR - The user sysa could not be looked up"
        exit 2
fi
Posted by: Guest on October-22-2021

C# Answers by Framework

Browse Popular Code Answers by Language