Nagarajan S Nagarajan S - 3 months ago 34x
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.


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.