Bash Scripting - Loops
Which of the following is a correct way to start an infinite loop in bash?
while true runs the loop forever because the condition is always true.while true; do echo Hello; done uses while true correctly. for i in 1..10; do echo $i; done loops 10 times, not infinite. if true; then echo Loop; fi is a conditional, not a loop. while false; do echo No; done never runs because condition is false.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions