Nagarajan S Nagarajan S - 1 year ago 236
Linux Question

Linux - Shell script run curl command in parallel

I would like to create linux shell script to run CURL command in parallel

For example: I have three command like

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

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

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

I want to call above three command simultaneously.

Any help is appreciated.

Answer Source

I think a bash script like:


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

However, this is starting all tasks as background processes. Don't know how crucial simultaneous starting of the process is.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download