.\" Man page generated from reStructuredText. . . .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 "END" "1" "Nov 13, 2025" "4.2" "fish-shell" .SH NAME end \- end a block of commands .SH SYNOPSIS .nf \fBbegin\fP [\fICOMMANDS\fP \&...] \fBend\fP .fi .sp .nf \fBfunction\fP \fINAME\fP [\fIOPTIONS\fP]\fB;\fP \fICOMMANDS\fP \&...\fB;\fP \fBend\fP \fBif\fP \fICONDITION\fP\fB;\fP \fICOMMANDS_TRUE\fP \&...\fB;\fP [\fBelse\fP\fB;\fP \fICOMMANDS_FALSE\fP \&...\fB;\fP] \fBend\fP \fBswitch\fP \fIVALUE\fP\fB;\fP [\fBcase\fP [\fIWILDCARD\fP \&...]\fB;\fP [\fICOMMANDS\fP \&...]\fB;\fP \&...] \fBend\fP \fBwhile\fP \fICONDITION\fP\fB;\fP \fICOMMANDS\fP \&...\fB;\fP \fBend\fP \fBfor\fP \fIVARNAME\fP \fBin\fP [\fIVALUES\fP \&...]\fB;\fP \fICOMMANDS\fP \&...\fB;\fP \fBend\fP .fi .sp .SH DESCRIPTION .sp The \fBend\fP keyword ends a block of commands started by one of the following commands: .INDENT 0.0 .IP \(bu 2 \fI\%begin\fP to start a block of commands .IP \(bu 2 \fI\%function\fP to define a function .IP \(bu 2 \fI\%if\fP, \fI\%switch\fP to conditionally execute commands .IP \(bu 2 \fI\%while\fP, \fI\%for\fP to perform commands multiple times .UNINDENT .sp The \fBend\fP keyword does not change the current exit status. Instead, the status after it will be the status returned by the most recent command. .SH COPYRIGHT fish-shell developers .\" Generated by docutils manpage writer. .