snippetbashTip
break — Break out of a `for`, `while`, `until`, or `select` loop. More information: <https://www.gnu.org/sof
Viewed 0 times
whilecommandbreakclioutuntilfor
Problem
How to use the
break command: Break out of a for, while, until, or select loop. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-break>.Solution
break — Break out of a for, while, until, or select loop. More information: <https://www.gnu.org/software/bash/manual/bash.html#index-break>.Break out of a single loop:
while :; do break; doneBreak out of nested loops:
while :; do while :; do break 2; done; doneCode Snippets
Break out of a single loop
while :; do break; doneBreak out of nested loops
while :; do while :; do break 2; done; doneContext
tldr-pages: common/break
Revisions (0)
No revisions yet.