bash if string is null code example
Example 1: bash if null or empty
if [ -z "$variable" ];
then echo "$variable is null";
else echo "$variable is not null";
fi
Example 2: bash stderr null
command > /dev/null # stderr
command > /dev/null 2>&1 # stdout and stderr
command &> /dev/null # stdout and stderr