How Do You End a While Loop in Linux?
Contents in the Following Example, We Are Using the Built-in Command: to Create an Infinite Loop. : Always Returns True. You Can Also Use the True Built-in or...
In the following example, we are using the built-in command : to create an infinite loop. : always returns true. You can also use the true built-in or any other statement that always returns true. The while loop above will run indefinitely. You can terminate the loop by pressing CTRL+C .
How do you kill a while loop?
Press Ctrl+C to kill.
Must Read
How do you end a loop in bash?
You can use the break command to exit from any loop, like the while and the until loops. The loop runs until it reaches 14 then the command exits the loop. The command exits the while loop, and that happens when the execution reaches the if statement.