shell字符串判空

主要用到两个命令

-n  -z

if [ -n "$PID" ]; then

  echo "PID is not empty"

fi

if[ -z "$PID" ]; then

  echo "PID is empty"

fi

原文地址:https://www.cnblogs.com/yinkh/p/5520882.html