检测test.php脚本是否存在,不存在则启动
一下是我写的:总是报错,报错类似于
"
./test.sh: line 2: [: missing `]'
wc: ]: No such file or directory
no
"
if [ ps -ef | grep test.php | wc -l ]; then
echo 'starting'
else
echo 'restart'
php /xxx/xxx/test.php
fi
检测test.php脚本是否存在,不存在则启动
一下是我写的:总是报错,报错类似于
"
./test.sh: line 2: [: missing `]'
wc: ]: No such file or directory
no
"
if [ ps -ef | grep test.php | wc -l ]; then
echo 'starting'
else
echo 'restart'
php /xxx/xxx/test.php
fi
2 回答721 阅读✓ 已解决
3 回答790 阅读
1 回答771 阅读
2 回答728 阅读
1 回答671 阅读
1 回答613 阅读
1 回答561 阅读
[和]中间的应当是test命令支持的参数,而不是一个命令。