How to repeatly request a URL in bash¶
In the following example, we request google every 1 second for 100 times.
for i in {1..100}
do curl https://google.com
sleep 1s
done
You can use semicolon to write in one line:
for i in {1..3};do curl https://google.com;sleep 1s;done
This article is originally created by tooli.top. Please indicate the source when reprinting : https://www.tooli.top/posts/repeat_request
Posted on 2022-03-23
Mail to author