how to run for loop in single line bash command code example Example: bash single line loop while true; do foo; sleep 2; done