Created
February 1, 2018 15:58
-
-
Save chetbox/a958cd64aebec31c833879cbc6e1b23b to your computer and use it in GitHub Desktop.
Run "curl" requests in parallel in a script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PARALLEL_JOBS=4 | |
parallel_curl() { | |
((i=i%$PARALLEL_JOBS)); ((i++==0)) && wait | |
curl "$@" & | |
} | |
parallel_curl https://url1.com | |
parallel_curl https://url2.com | |
parallel_curl https://url3.com | |
parallel_curl https://url4.com | |
parallel_curl https://url5.com | |
parallel_curl https://url6.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment