b1=
b2=""
b3="hello"
if [[ -n "${b3}" ]]
then
echo "not null"
else
echo "null"
fi
b1 null
b2 null
b3 not null
-n str 字符串长度非零
时间: 2024-11-04 19:06:08
b1=
b2=""
b3="hello"
if [[ -n "${b3}" ]]
then
echo "not null"
else
echo "null"
fi
b1 null
b2 null
b3 not null
-n str 字符串长度非零