Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / break.1
blobac065495a758b330e30f8980f4669f8f4d92b43c
1 '\" te
2 .\" Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" Portions Copyright (c) 1982-2007 AT&T Knowledge Ventures
5 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
6 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
7 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
8 .TH BREAK 1 "Apr 8, 2008"
9 .SH NAME
10 break, continue \- shell built-in functions to escape from or advance within a
11 controlling while, for, foreach, or until loop
12 .SH SYNOPSIS
13 .SS "\fBsh\fR"
14 .LP
15 .nf
16 \fBbreak\fR [\fIn\fR]
17 .fi
19 .LP
20 .nf
21 \fBcontinue\fR [\fIn\fR]
22 .fi
24 .SS "\fBcsh\fR"
25 .LP
26 .nf
27 \fBbreak\fR
28 .fi
30 .LP
31 .nf
32 \fBcontinue\fR
33 .fi
35 .SS "\fBksh\fR"
36 .LP
37 .nf
38 \fB*break\fR [\fIn\fR]
39 .fi
41 .LP
42 .nf
43 \fB*continue\fR [\fIn\fR]
44 .fi
46 .SS "\fBksh93\fR"
47 .LP
48 .nf
49 \fB+break\fR [\fIn\fR]
50 .fi
52 .LP
53 .nf
54 \fB+continue\fR [\fIn\fR]
55 .fi
57 .SH DESCRIPTION
58 .SS "\fBsh\fR"
59 .sp
60 .LP
61 The \fBbreak\fR utility exits from the enclosing \fBfor\fR or \fBwhile\fR loop,
62 if any. If \fIn\fR is specified, break \fIn\fR levels.
63 .sp
64 .LP
65 The \fBcontinue\fR utility resumes the next iteration of the enclosing
66 \fBfor\fR or \fBwhile\fR loop. If \fIn\fR is specified, resume at the
67 \fIn\fR-th enclosing loop.
68 .SS "\fBcsh\fR"
69 .sp
70 .LP
71 The \fBbreak\fR utility resumes execution after the \fBend\fR of the nearest
72 enclosing \fBforeach\fR or \fBwhile\fR loop. The remaining commands on the
73 current line are executed. This allows multilevel breaks to be written as a
74 list of \fBbreak\fR commands, all on one line.
75 .sp
76 .LP
77 The \fBcontinue\fR utility continues execution of the next iteration of the
78 nearest enclosing \fBwhile\fR or \fBforeach\fR loop.
79 .SS "\fBksh\fR"
80 .sp
81 .LP
82 The \fBbreak\fR utility exits from the enclosed \fBfor\fR, \fBwhile\fR,
83 \fBuntil\fR, or \fBselect\fR loop, if any. If \fIn\fR is specified, then
84 \fBbreak\fR \fIn\fR levels. If \fIn\fR is greater than the number of enclosing
85 loops, the outermost enclosing loop shall be exited.
86 .sp
87 .LP
88 The \fBcontinue\fR utility resumes the next iteration of the enclosed
89 \fBfor\fR, \fBwhile\fR, \fBuntil\fR, or \fBselect\fR loop. If \fIn\fR is
90 specified then resume at the \fIn\fR-th enclosed loop. If \fIn\fR is greater
91 than the number of enclosing loops, the outermost enclosing loop shall be used.
92 .sp
93 .LP
94 On this manual page, \fBksh\fR(1) commands that are preceded by one or two *
95 (asterisks) are treated specially in the following ways:
96 .RS +4
97 .TP
99 Variable assignment lists preceding the command remain in effect when the
100 command completes.
102 .RS +4
105 \fBI/O\fR redirections are processed after variable assignments.
107 .RS +4
110 Errors cause a script that contains them to abort.
112 .RS +4
115 Words that follow a command preceded by \fB**\fR that are in the format of a
116 variable assignment are expanded with the same rules as a variable assignment.
117 This means that tilde substitution is performed after the \fB=\fR sign, and
118 also that word splitting and file name generation are not performed.
120 .SS "\fBksh93\fR"
123 \fBbreak\fR is a shell special built-in that exits the smallest enclosing
124 \fBfor\fR, \fBselect\fR, \fBwhile\fR, or \fBuntil\fR loop. It also exits the
125 \fIn\fRth enclosing loop if \fIn\fR is specified. Execution continues at the
126 command following the loop or loops.
129 If \fIn\fR is specified, it must be a positive integer \fB\(>=1\fR\&. If
130 \fIn\fR is larger than the number of enclosing loops, the last enclosing loop
131 is exited.
134 \fBcontinue\fR is a shell special built-in that continues execution at the top
135 of the smallest enclosing \fBfor\fR, \fBselect\fR, \fBwhile\fR, or \fBuntil\fR
136 loop, if any; or of the top of the \fIn\fRth enclosing loop if n is specified.
139 If \fIn\fR is specified, it must be a positive integer \fB\(>=1\fR\&. If
140 \fIn\fR is larger than the number of enclosing loops, the last enclosing loop
141 is used.
144 On this manual page, \fBksh93\fR(1) commands that are preceded by one or two
145 \fB+\fR symbols are special built-in commands and are treated the following
146 ways:
147 .RS +4
150 Variable assignment lists preceding the command remain in effect when the
151 command completes.
153 .RS +4
156 I/O redirections are processed after variable assignments.
158 .RS +4
161 Errors cause a script that contains them to abort.
163 .RS +4
166 Built-in commands are not valid function names.
168 .RS +4
171 Words following a command preceded by \fB++\fR that are in the format of a
172 variable assignment are expanded with rules as a variable assignment. This
173 means that tilde substitution is performed after the \fB=\fR sign and field
174 splitting and file name generation are not performed.
176 .SH SEE ALSO
179 \fBcsh\fR(1), \fBexit\fR(1), \fBksh\fR(1), \fBksh93\fR(1), \fBsh\fR(1),
180 \fBattributes\fR(5)