.\" 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 "ELSE" "1" "Nov 13, 2025" "4.2" "fish-shell" .SH NAME else \- execute command if a condition is not met .SH SYNOPSIS .nf \fBif\fP \fICONDITION\fP\fB;\fP \fICOMMANDS_TRUE\fP \&...\fB;\fP [\fBelse\fP\fB;\fP \fICOMMANDS_FALSE\fP \&...\fB;\fP] \fBend\fP .fi .sp .SH DESCRIPTION .sp \fI\%if\fP will execute the command \fICONDITION*\fP\&. If the condition\(aqs exit status is 0, the commands \fICOMMANDS_TRUE\fP will execute. If it is not 0 and \fBelse\fP is given, \fICOMMANDS_FALSE\fP will be executed. .SH EXAMPLE .sp The following code tests whether a file \fIfoo.txt\fP exists as a regular file. .INDENT 0.0 .INDENT 3.5 .sp .EX if test \-f foo.txt echo foo.txt exists else echo foo.txt does not exist end .EE .UNINDENT .UNINDENT .SH COPYRIGHT fish-shell developers .\" Generated by docutils manpage writer. .