.\" Man page generated from reStructuredText .\" by the Docutils 0.23 manpage writer. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "BREAK" "1" "Sep 09, 2026" "4.9" "fish-shell" .SH NAME break \- stop the current inner loop .SH SYNOPSIS .nf \fILOOP_CONSTRUCT\fP [\fICOMMANDS\fP \&...] \fBbreak\fP [\fICOMMANDS\fP \&...] \fBend\fP .fi .sp .SH DESCRIPTION .sp \fBbreak\fP halts a currently running loop (\fILOOP_CONSTRUCT\fP), such as a for \%<> or while \%<> loop. It is usually added inside of a conditional block such as an if \%<> block. .sp The \fB\-h\fP or \fB\-\-help\fP option displays help about using this command. .SH EXAMPLE .sp The following code searches all .c files for \(dqsmurf\(dq, and halts at the first occurrence. .INDENT 0.0 .INDENT 3.5 .sp .EX for i in *.c if grep smurf $i echo Smurfs are present in $i break end end .EE .UNINDENT .UNINDENT .SH SEE ALSO .INDENT 0.0 .IP \(bu 2 the continue \%<> command, to skip the remainder of the current iteration of the current inner loop .UNINDENT .SH Copyright fish-shell developers .\" End of generated man page.