[mess] [bash] 测试一个字符串长度为零

Bash 中使用 -z 测试一个字符串长度为零

VERSION="2018.08"

if [[ -z $VERSION ]]; then
  echo "would not print"
fi

if [[ -z $NOT_EXIST ]]; then
  echo "test pass"
fi

猜你喜欢

转载自www.cnblogs.com/wander4096/p/9448114.html
今日推荐