AnonSec Team
Server IP : 161.35.85.9  /  Your IP : 216.73.216.209
Web Server : nginx/1.30.1
System : Linux cheapdeb-ams3 7.0.9+deb14-amd64 #1 SMP PREEMPT_DYNAMIC Debian 7.0.9-1 (2026-05-22) x86_64
User : root ( 0)
PHP Version : 8.2.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /usr/share/java/../python-apt/../python3/../python/../java/../java/../python/../fish/man/man1/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /usr/share/java/../python-apt/../python3/../python/../java/../java/../python/../fish/man/man1/for.1
.\" Man page generated from reStructuredText
.\" by the Docutils 0.22.4 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 "FOR" "1" "May 15, 2026" "4.7" "fish-shell"
.SH NAME
for \- perform a set of commands multiple times
.SH SYNOPSIS
.nf
\fBfor\fP \fIVARNAME\fP \fBin\fP [\fIVALUES\fP \&...]\fB;\fP \fICOMMANDS\fP \&...\fB;\fP \fBend\fP
.fi
.sp
.SH DESCRIPTION
.sp
\fBfor\fP is a loop construct. It will perform the commands specified by \fICOMMANDS\fP multiple times. On each iteration, the local variable specified by \fIVARNAME\fP is assigned a new value from \fIVALUES\fP\&. If \fIVALUES\fP is empty, \fICOMMANDS\fP will not be executed at all. The \fIVARNAME\fP is visible when the loop terminates and will contain the last value assigned to it. If \fIVARNAME\fP does not already exist it will be set in the local scope. For our purposes if the \fBfor\fP block is inside a function there must be a local variable with the same name. If the \fBfor\fP block is not nested inside a function then global and universal variables of the same name will be used if they exist.
.sp
Much like set \%<>, \fBfor\fP does not modify $status, but the evaluation of its subordinate commands can.
.sp
The \fB\-h\fP or \fB\-\-help\fP option displays help about using this command.
.SH EXAMPLE
.INDENT 0.0
.INDENT 3.5
.sp
.EX
for i in foo bar baz; echo $i; end

# would output:
foo
bar
baz
.EE
.UNINDENT
.UNINDENT
.SH NOTES
.sp
The \fBVARNAME\fP was local to the for block in releases prior to 3.0.0. This means that if you did something like this:
.INDENT 0.0
.INDENT 3.5
.sp
.EX
for var in a b c
    if break_from_loop
        break
    end
end
echo $var
.EE
.UNINDENT
.UNINDENT
.sp
The last value assigned to \fBvar\fP when the loop terminated would not be available outside the loop. What \fBecho $var\fP would write depended on what it was set to before the loop was run. Likely nothing.
.SH Copyright
fish-shell developers
.\" End of generated man page.

AnonSec - 2021