.TH "while" 1 "8 Feb 2007" "Version 1.22.3" "fish" \" -*- nroff -*- .ad l .nh .SH NAME while - perform a command multiple times .PP .SS "Synopsis" \fCwhile CONDITION; COMMANDS...; end\fP .SS "Description" The \fCwhile\fP builtin causes fish to continually execute CONDITION and execute COMMANDS as long as CONDITION returned with status 0. If CONDITION is false on the first time, COMMANDS will not be executed at all. Hints: use \fC\fCbegin; ...; end\fP\fP for complex conditions; more complex control can be achieved with \fCwhile true\fP containing a \fCbreak\fP. .SS "Example" \fCwhile test -f foo.txt; echo file exists; sleep 10; end\fP .PP causes fish to print the line 'file exists' at 10 second intervals as long as the file foo.txt exists.