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

Posted on 2022-03-23