xref: /netbsd-src/usr.bin/pwait/pwait.1 (revision b52075bfab689507b746a417ac94c9018d20be44)
1.\"	$NetBSD: pwait.1,v 1.4 2015/03/04 16:36:12 christos Exp $
2.\"
3.\" Copyright (c) 2004-2009, Jilles Tjoelker
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with
7.\" or without modification, are permitted provided that the
8.\" following conditions are met:
9.\"
10.\" 1. Redistributions of source code must retain the above
11.\"    copyright notice, this list of conditions and the
12.\"    following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the
14.\"    above copyright notice, this list of conditions and
15.\"    the following disclaimer in the documentation and/or
16.\"    other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19.\" CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
20.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22.\" PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23.\" COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
24.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
31.\" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
32.\" OF SUCH DAMAGE.
33.\"
34.\" $FreeBSD: head/bin/pwait/pwait.1 233648 2012-03-29 05:02:12Z eadler $
35.\"
36.Dd March 4, 2015
37.Dt PWAIT 1
38.Os
39.Sh NAME
40.Nm pwait
41.Nd wait for processes to terminate
42.Sh SYNOPSIS
43.Nm
44.Op Fl isv
45.Op Fl t Ar timeout
46.Ar pid
47\&...
48.Sh DESCRIPTION
49The
50.Nm
51utility will wait until each of the given processes has terminated.
52.Pp
53The following option is available:
54.Bl -tag -width indent
55.It Fl i
56Don't wait for all the processes, exit after the first process or group
57of processes exit.
58.It Fl s
59Exit with the status code of the first non-zero exit status pid, or
60if timed out exit with
61.Dv 255 .
62.It Fl t Ar timeout
63Only wait for
64.Ar timeout
65seconds before exiting.
66.It Fl v
67Print the exit status when each process terminates.
68.El
69.Sh DIAGNOSTICS
70The
71.Nm
72utility returns 0 on success, and >0 if an error occurs.
73.Pp
74Invalid pids elicit a warning message but are otherwise ignored.
75.Sh SEE ALSO
76.Xr kill 1 ,
77.Xr pkill 1 ,
78.Xr ps 1 ,
79.Xr wait 1 ,
80.Xr kqueue 2
81.Sh NOTES
82.Nm
83is not a substitute for the
84.Xr wait 1
85builtin
86as it will not clean up any zombies or state in the parent process.
87.Sh HISTORY
88A
89.Nm
90command first appeared in SunOS 5.8.
91