Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 等待Curl命令结束_Php_Shell_Curl - Fatal编程技术网

Php 等待Curl命令结束

Php 等待Curl命令结束,php,shell,curl,Php,Shell,Curl,我有这个shell脚本,可以连续运行两个php脚本 while [ true ] do curl -s 'example.com/first.php' > /dev/null curl -s 'example.com/second.php' > /dev/null sleep 30; done 但有时我认为它不能正常工作,例如它同时运行两次first.php。 curl命令是否在first.php进程结束之前运行second.php?我怎样才能解决这个问题?

我有这个shell脚本,可以连续运行两个php脚本

while [ true ]
do
    curl -s 'example.com/first.php' > /dev/null
    curl -s 'example.com/second.php' > /dev/null
    sleep 30;
done
但有时我认为它不能正常工作,例如它同时运行两次
first.php
curl
命令是否在
first.php
进程结束之前运行
second.php
?我怎样才能解决这个问题? 我也没有在我的
first.php
second.php中使用
exit