shell脚本的问题,大家帮看下。 ps -ef|grep -v "grep"|grep -v "dic.sh"|grep APPSVR|awk '{print $2}'|while read i do pid=$i echo 'pid=${pid}:input "y" to kill the process of APPSVR,input "n" to continue.' read oper while [[ "x"$oper != "xy" && "x"$oper != "xn" ]] do echo 'your input is error,please input "y" or "n".' read oper done if [ "$oper"x = "y"x ];then kill -15 ${pid} if [ $? -ne 0 ]; then echo "kill the process of APPSVR is failed." exit fi fi done 第二个read oper的时候,oper的值总是上面结果的值,我的本意是提示我输入y或者n,要不要kill这个pid。现在根本没有提示,程序一直死循环在echo 'your input is error,please input "y" or "n".' 大家帮忙看看怎解决啊。