xref: /csrg-svn/share/man/man1/wait.1 (revision 50798)
1*50798Scael.\" Copyright (c) 1991 Regents of the University of California.
250068Sbostic.\" All rights reserved.
319542Smckusick.\"
4*50798Scael.\" %sccs.include.redist.roff%
550068Sbostic.\"
6*50798Scael.\"     @(#)wait.1	6.3 (Berkeley) 08/07/91
750068Sbostic.\"
8*50798Scael.Dd
9*50798Scael.Dt WAIT 1
10*50798Scael.Os
11*50798Scael.Sh NAME
12*50798Scael.Nm wait
13*50798Scael.Nd await process completion
14*50798Scael.Sh SYNOPSIS
15*50798Scael.Nm wait
16*50798Scael.Op Ar pid
17*50798Scael.Sh DESCRIPTION
18*50798ScaelIf invoked with no arguments, the
19*50798Scael.Nm wait
20*50798Scaelutility waits until
21*50798Scaelall existing child processes in the background
22*50798Scaelhave terminated.
23*50798Scael.Pp
24*50798ScaelAvailable operands:
25*50798Scael.Bl -tag -width Ds
26*50798Scael.It Ar pid
27*50798ScaelIf a
28*50798Scael.Ar pid
29*50798Scaeloperand is specified, and it is the process ID of a
30*50798Scaelbackground child process that still exists, the
31*50798Scael.Nm wait
32*50798Scaelutility
33*50798Scaelwaits until that process has completed and consumes its
34*50798Scaelstatus information, without consuming the status information
35*50798Scaelof any other process.
36*50798Scael.Pp
37*50798ScaelIf a pid operand is specified that is not the process ID of
38*50798Scaela child background process that still exists,
39*50798Scael.Nm wait
40*50798Scaelexits
41*50798Scaelwithout waiting for any processes to complete.
42*50798Scael.El
43*50798Scael.Pp
44*50798ScaelThe
45*50798Scael.Nm wait
46*50798Scaelutility exits with one of the following values:
47*50798Scael.Bl -tag -width Ds
48*50798Scael.It \&0
49*50798ScaelThe
50*50798Scael.Nm wait
51*50798Scaelutility was invoked with no operands and
52*50798Scaelall of the existing background child processes have
53*50798Scaelterminated, or the process specified by the pid
54*50798Scaeloperand exited normally with 0 as its exit status.
55*50798Scael.It \&>\&0
56*50798ScaelThe specified process did not exist and its exit
57*50798Scaelstatus information was not available, or the specified
58*50798Scaelprocess existed or its exit status information
59*50798Scaelwas available, and it terminated with a non-zero
60*50798Scaelexit status.
61*50798Scael.El
62*50798Scael.Pp
63*50798ScaelIf the specified process terminated abnormally due
64*50798Scaelto the receipt of a signal, the exit status
65*50798Scaelinformation of
66*50798Scael.Nm wait
67*50798Scaelcontains that termination status as
68*50798Scaelwell.
69*50798Scael.Sh STANDARDS
70*50798ScaelThe
71*50798Scael.Nm wait
72*50798Scaelcommand is expected to be
73*50798Scael.St -p1003.2
74*50798Scaelcompatible.
75