xref: /freebsd/bin/pwait/pwait.1 (revision 2362bc2cf533639c55165e3d5b870109ec69976f)
10e5e4167SJilles Tjoelker.\"
20e5e4167SJilles Tjoelker.\" Copyright (c) 2004-2009, Jilles Tjoelker
30e5e4167SJilles Tjoelker.\" All rights reserved.
40e5e4167SJilles Tjoelker.\"
50e5e4167SJilles Tjoelker.\" Redistribution and use in source and binary forms, with
60e5e4167SJilles Tjoelker.\" or without modification, are permitted provided that the
70e5e4167SJilles Tjoelker.\" following conditions are met:
80e5e4167SJilles Tjoelker.\"
90e5e4167SJilles Tjoelker.\" 1. Redistributions of source code must retain the above
100e5e4167SJilles Tjoelker.\"    copyright notice, this list of conditions and the
110e5e4167SJilles Tjoelker.\"    following disclaimer.
120e5e4167SJilles Tjoelker.\" 2. Redistributions in binary form must reproduce the
130e5e4167SJilles Tjoelker.\"    above copyright notice, this list of conditions and
140e5e4167SJilles Tjoelker.\"    the following disclaimer in the documentation and/or
150e5e4167SJilles Tjoelker.\"    other materials provided with the distribution.
160e5e4167SJilles Tjoelker.\"
170e5e4167SJilles Tjoelker.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
180e5e4167SJilles Tjoelker.\" CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
190e5e4167SJilles Tjoelker.\" WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
200e5e4167SJilles Tjoelker.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
210e5e4167SJilles Tjoelker.\" PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
220e5e4167SJilles Tjoelker.\" COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
230e5e4167SJilles Tjoelker.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
240e5e4167SJilles Tjoelker.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
250e5e4167SJilles Tjoelker.\" PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
260e5e4167SJilles Tjoelker.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
270e5e4167SJilles Tjoelker.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
280e5e4167SJilles Tjoelker.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
290e5e4167SJilles Tjoelker.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
300e5e4167SJilles Tjoelker.\" USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
310e5e4167SJilles Tjoelker.\" OF SUCH DAMAGE.
320e5e4167SJilles Tjoelker.\"
330e5e4167SJilles Tjoelker.\" $FreeBSD$
340e5e4167SJilles Tjoelker.\"
35*2362bc2cSPawel Jakub Dawidek.Dd January 26, 2020
360e5e4167SJilles Tjoelker.Dt PWAIT 1
37aa12cea2SUlrich Spörlein.Os
380e5e4167SJilles Tjoelker.Sh NAME
390e5e4167SJilles Tjoelker.Nm pwait
400e5e4167SJilles Tjoelker.Nd wait for processes to terminate
410e5e4167SJilles Tjoelker.Sh SYNOPSIS
420e5e4167SJilles Tjoelker.Nm
43b06b52baSBryan Drewery.Op Fl t Ar duration
44*2362bc2cSPawel Jakub Dawidek.Op Fl ov
450e5e4167SJilles Tjoelker.Ar pid
460e5e4167SJilles Tjoelker\&...
470e5e4167SJilles Tjoelker.Sh DESCRIPTION
480e5e4167SJilles TjoelkerThe
490e5e4167SJilles Tjoelker.Nm
500e5e4167SJilles Tjoelkerutility will wait until each of the given processes has terminated.
510e5e4167SJilles Tjoelker.Pp
520e5e4167SJilles TjoelkerThe following option is available:
530e5e4167SJilles Tjoelker.Bl -tag -width indent
54*2362bc2cSPawel Jakub Dawidek.It Fl o
55*2362bc2cSPawel Jakub DawidekExit when any of the given processes has terminated.
56b06b52baSBryan Drewery.It Fl t Ar duration
57b06b52baSBryan DreweryIf any process is still running after
58b06b52baSBryan Drewery.Ar duration ,
59b06b52baSBryan Drewery.Nm
60b06b52baSBryan Drewerywill exit.
61b06b52baSBryan DreweryThe
62b06b52baSBryan Drewery.Ar duration
63b06b52baSBryan Dreweryvalue can be integer or decimal numbers.
64b06b52baSBryan DreweryValues without unit symbols are interpreted as seconds.
65b06b52baSBryan Drewery.Pp
66b06b52baSBryan DrewerySupported unit symbols are:
67b06b52baSBryan Drewery.Bl -tag -width indent -compact
68b06b52baSBryan Drewery.It s
69b06b52baSBryan Dreweryseconds
70b06b52baSBryan Drewery.It m
71b06b52baSBryan Dreweryminutes
72b06b52baSBryan Drewery.It h
73b06b52baSBryan Dreweryhours
74b06b52baSBryan Drewery.El
750e5e4167SJilles Tjoelker.It Fl v
760e5e4167SJilles TjoelkerPrint the exit status when each process terminates.
770e5e4167SJilles Tjoelker.El
78b06b52baSBryan Drewery.Sh EXIT STATUS
790e5e4167SJilles TjoelkerThe
800e5e4167SJilles Tjoelker.Nm
81b06b52baSBryan Dreweryutility exits 0 on success, and >0 if an error occurs.
82b06b52baSBryan Drewery.Pp
83b06b52baSBryan DreweryIf the
84b06b52baSBryan Drewery.Fl t
85b06b52baSBryan Dreweryflag is specified and a timeout occurs, the exit status will be 124.
860e5e4167SJilles Tjoelker.Pp
870e5e4167SJilles TjoelkerInvalid pids elicit a warning message but are otherwise ignored.
880e5e4167SJilles Tjoelker.Sh SEE ALSO
890e5e4167SJilles Tjoelker.Xr kill 1 ,
900e5e4167SJilles Tjoelker.Xr pkill 1 ,
910e5e4167SJilles Tjoelker.Xr ps 1 ,
920e5e4167SJilles Tjoelker.Xr wait 1 ,
930e5e4167SJilles Tjoelker.Xr kqueue 2
940e5e4167SJilles Tjoelker.Sh NOTES
950e5e4167SJilles Tjoelker.Nm
960e5e4167SJilles Tjoelkeris not a substitute for the
970e5e4167SJilles Tjoelker.Xr wait 1
980e5e4167SJilles Tjoelkerbuiltin
990e5e4167SJilles Tjoelkeras it will not clean up any zombies or state in the parent process.
1000e5e4167SJilles Tjoelker.Sh HISTORY
1010e5e4167SJilles TjoelkerA
1020e5e4167SJilles Tjoelker.Nm
1030e5e4167SJilles Tjoelkercommand first appeared in SunOS 5.8.
104