SH 里的 IF 的判断,如果与空字符串进行比较,需要对变量加上双引号 1 if [ "${CMD_RES}" == "" ]; then 2 <do something> 3 fi 转载于:https://www.cnblogs.com/YBhello/p/5354919.html