内容如下:
#!/bin/bash
#program:
#This progrem auto check-up netsafe_log process and delete this process.
testing443=`(netstat -an | grep 443 )`
while [ "$testing443" = "" ]
do
/home/admin/Onion/Start443.sh
done
testing9002=`(netstat -an | grep 9002)`
while [ "$testing9002" = "" ]
do
/home/admin/Onion/Start9002.sh
done
但是总是报错:
: command not founde 4:
: command not founde 5:
: command not founde 6:
netsafe_log.sh: line 18: syntax error: unexpected end of file
请问这个是怎么回事?
while [ "$testing443" = "" ]中单个=号是赋值的意思,应换成==
载入/home/admin/Onion/Start443.sh 脚本的时候最好使用sh /home/admin/Onion/Start443.sh,或者使用source或者.(一个点)载入其他脚本。
载入/home/admin/Onion/Start443.sh 脚本的时候最好使用sh /home/admin/Onion/Start443.sh,或者使用source或者.(一个点)载入其他脚本。
温馨提示:答案为网友推荐,仅供参考
第1个回答 2011-07-25
while [ "$testing443" = "" ]
空值比较不要这样使用,应该这样:
while [ "NULL$testing443" = "NULL" ]
空值比较不要这样使用,应该这样:
while [ "NULL$testing443" = "NULL" ]
第2个回答 2011-07-21
是“==”,不是“=”
第3个回答 2011-07-21
你把那些空格全部去掉 试试