shell脚本报错:"[: =: unary operator expected"
pid=`ps -ef|grep deploy|egrep -v 'grep'|awk -F '[ ]+' '{print $3}'` if [ $pid -ne 0 ] then kill $pid fi
上面脚本执行报错"[: =: unary operator expected"
需要把[ $pid -ne 0 ] 改为"[[ $pid -ne 0 ]]"即可
您的资助是我最大的动力!
金额随意,欢迎来赏!