Bash 中使用 -z
测试一个字符串长度为零
VERSION="2018.08"
if [[ -z $VERSION ]]; then
echo "would not print"
fi
if [[ -z $NOT_EXIST ]]; then
echo "test pass"
fi
Bash 中使用 -z
测试一个字符串长度为零
VERSION="2018.08"
if [[ -z $VERSION ]]; then
echo "would not print"
fi
if [[ -z $NOT_EXIST ]]; then
echo "test pass"
fi