1.\" Copyright (c) 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)wait.1 8.1 (Berkeley) 06/05/93 7.\" 8.Dd 9.Dt WAIT 1 10.Os 11.Sh NAME 12.Nm wait 13.Nd await process completion 14.Sh SYNOPSIS 15.Nm wait 16.Op Ar pid 17.Sh DESCRIPTION 18If invoked with no arguments, the 19.Nm wait 20utility waits until 21all existing child processes in the background 22have terminated. 23.Pp 24Available operands: 25.Bl -tag -width Ds 26.It Ar pid 27If a 28.Ar pid 29operand is specified, and it is the process ID of a 30background child process that still exists, the 31.Nm wait 32utility 33waits until that process has completed and consumes its 34status information, without consuming the status information 35of any other process. 36.Pp 37If a pid operand is specified that is not the process ID of 38a child background process that still exists, 39.Nm wait 40exits 41without waiting for any processes to complete. 42.El 43.Pp 44The 45.Nm wait 46utility exits with one of the following values: 47.Bl -tag -width Ds 48.It \&0 49The 50.Nm wait 51utility was invoked with no operands and 52all of the existing background child processes have 53terminated, or the process specified by the pid 54operand exited normally with 0 as its exit status. 55.It \&>\&0 56The specified process did not exist and its exit 57status information was not available, or the specified 58process existed or its exit status information 59was available, and it terminated with a non-zero 60exit status. 61.El 62.Pp 63If the specified process terminated abnormally due 64to the receipt of a signal, the exit status 65information of 66.Nm wait 67contains that termination status as 68well. 69.Sh STANDARDS 70The 71.Nm wait 72command is expected to be 73.St -p1003.2 74compatible. 75