: [: too many arguments
来源:6-1 函数定义和使用
abel_星123
2019-09-03
代码是一样的为什么回报参数太多?
#!/bin/bash
#
this_pid=$$
status=`ps -ef | grep redis | grep -v grep | grep -v $this_pid`
if [ $status -eq 0 ];then
echo "run"
else
echo "stop"
fi
start.sh: line 4: [: too many arguments
stop
写回答
2回答
-
墨7228
2019-10-12
#!/bin/bash # systemctl status nginx &>/dev/null if [ $? -eq 0 ];then echo "nginx is running well" sleep 10 else systemctl start nginx echo "nginx is down, starting it ..." fi
00 -
酷田
2019-09-03
同学您好,继续往后面看可以看到答案,你只看了这个章节的前半段了吧,后面老师有调试过程和更改的
00
相似问题