bash check if string emptz code example
Example: bash script check empty string
if [ -z "$var" ]
then
echo "\$var is empty"
else
echo "\$var is NOT empty"
fi
if [ -z "$var" ]
then
echo "\$var is empty"
else
echo "\$var is NOT empty"
fi