bash infinite loop one line code example
Example 1: while bash one line
while CONDITION_STATEMENT; do SOME_CODE; done
Example 2: bash single line loop
while true; do foo; sleep 2; done
while CONDITION_STATEMENT; do SOME_CODE; done
while true; do foo; sleep 2; done