Answers for "bash if equal $null"

C#
11

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

bash if equal

Use == operator with bash if statement to check if two strings are equal.
You can also use != to check if two string are not equal.
You must use single space before and after the == and != operators.
Posted by: Guest on November-18-2021

C# Answers by Framework

Browse Popular Code Answers by Language