IT&Linux 解决Shell编程中的”[: =: binary operator expected” 2016年8月30日 yl 发表回复 以下语句 if [ -n $curStr ];then sentence fi 如果$curStr为空,就会产生”[: =: binary operator expected” 的错误。 解决办法: if [[ -n $curStr ]];then sentence fi