The solution to this is to use the xargs command as shown alongside the curl command. The -P flag denotes the number of requests in parallel. The section <(printf '%s\n' {1.. 10}) prints out the numbers 1 – 10 and causes the curl command to run 10 times with 5 requests running in parallel.
The curl command transfers data to or from a network server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, DICT, TELNET, LDAP or FILE). It is designed to work without user interaction, so it is ideal for use in a shell script.
How to send HTTP headers with a Curl GET request? To make a GET request with HTTP headers, use the -H command-line option. You can pass as many HTTP headers with your Curl GET request as you like using the -H command line multiple times.
I would like to create linux shell script to run CURL command in parallel
For example: I have three command like
I want to call above three command simultaneously.
Any help is appreciated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With