加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

Linux – Shell脚本并行运行curl命令

发布时间:2020-12-14 01:49:51 所属栏目:Linux 来源:网络整理
导读:我想创建 linux shell脚本来并行运行CURL命令 例如:我有三个命令 卷曲-s http://localhost/process.php?id=1 卷曲-s http://localhost/process.php?id=2 卷曲-s http://localhost/process.php?id=3 我想同时调用上面三个命令. 任何帮助表示赞赏. 解决方法
我想创建 linux shell脚本来并行运行CURL命令

例如:我有三个命令

>卷曲-s http://localhost/process.php?id=1
>卷曲-s http://localhost/process.php?id=2
>卷曲-s http://localhost/process.php?id=3

我想同时调用上面三个命令.

任何帮助表示赞赏.

解决方法

我认为一个bash脚本如:

#!/bin/bash

curl -s http://localhost/process.php?id=1 &
curl -s http://localhost/process.php?id=2 &
curl -s http://localhost/process.php?id=3 &

但是,这将作为后台进程启动所有任务.不知道同时启动过程有多重要.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读