How do you stop a command loop?

Thành Nguyễn

New member
How do you stop a command loop?
Answer
If you want ctrl+c to stop the loop, but not terminate the script, you can place || break after whatever command you’re running. As long as the program you’re running terminates on ctrl+c, this works great. If you’re in nested loop, you can use “break 2” to get out of two levels, etc.
 

Tìm kiếm

Back
Top