.\" 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 "WAIT" "1" "Nov 13, 2025" "4.2" "fish-shell" .SH NAME wait \- wait for jobs to complete .SH SYNOPSIS .nf \fBwait\fP [\fB\-n\fP | \fB\-\-any\fP] [\fIPID\fP | \fIPROCESS_NAME\fP] \&... .fi .sp .SH DESCRIPTION .sp NOTE: This page documents the fish builtin \fBwait\fP\&. To see the documentation on any non\-fish versions, use \fBcommand man wait\fP\&. .sp \fBwait\fP waits for child jobs to complete. .sp If a \fIPID\fP is specified, the command waits for the job that the process with that process ID belongs to. .sp If a \fIPROCESS_NAME\fP is specified, the command waits for the jobs that the matched processes belong to. .sp If neither a pid nor a process name is specified, the command waits for all background jobs. .sp If the \fB\-n\fP or \fB\-\-any\fP flag is provided, the command returns as soon as the first job completes. If it is not provided, it returns after all jobs complete. .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 sleep 10 & wait $last_pid .EE .UNINDENT .UNINDENT .sp spawns \fBsleep\fP in the background, and then waits until it finishes. .INDENT 0.0 .INDENT 3.5 .sp .EX for i in (seq 1 5); sleep 10 &; end wait .EE .UNINDENT .UNINDENT .sp spawns five jobs in the background, and then waits until all of them finish. .INDENT 0.0 .INDENT 3.5 .sp .EX for i in (seq 1 5); sleep 10 &; end hoge & wait sleep .EE .UNINDENT .UNINDENT .sp spawns five \fBsleep\fP jobs and \fBhoge\fP in the background, and then waits until all \fBsleep\fPs finish, and doesn\(aqt wait for \fBhoge\fP\&. .SH COPYRIGHT fish-shell developers .\" Generated by docutils manpage writer. .