bash loop with interactive commands code example
Example 1: bash single line loop
while true; do foo; sleep 2; done
Example 2: how to collect values from each iteration of a loop and save them bash
VARIABLE=$(for time in ...; do ...; done)
while true; do foo; sleep 2; done
VARIABLE=$(for time in ...; do ...; done)