Linux and Unix break and continue

Quick links

About break and continue
Syntax
Examples
Related commands
Linux and Unix main page

About break and continue

Shell built-in functions to escape from or advance within a controlling while, for, foreach or until loop.

Syntax

break [n]

continue [n]

nThe number of the break. The default number is 1.

Examples

break

Within a script or while in any of the above processes would escape out of that process or script. Must actually be in a processes before being able to break from it.

Related commands

csh
exit
for
foreach
ksh
sh
until
while