bash if parameter is empty code example
Example 1: bash if empty params
if [ -z "$var" ]
then
echo "\$var is empty"
else
echo "\$var is NOT empty"
fi
Example 2: bash check if variable is empty
if [ -z "$var" ] #return true if $var is unset