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*b06b52baSBryan Drewery.Dd March 7, 2017 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 43*b06b52baSBryan Drewery.Op Fl t Ar duration 440e5e4167SJilles Tjoelker.Op Fl v 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*b06b52baSBryan Drewery.It Fl t Ar duration 55*b06b52baSBryan DreweryIf any process is still running after 56*b06b52baSBryan Drewery.Ar duration , 57*b06b52baSBryan Drewery.Nm 58*b06b52baSBryan Drewerywill exit. 59*b06b52baSBryan DreweryThe 60*b06b52baSBryan Drewery.Ar duration 61*b06b52baSBryan Dreweryvalue can be integer or decimal numbers. 62*b06b52baSBryan DreweryValues without unit symbols are interpreted as seconds. 63*b06b52baSBryan Drewery.Pp 64*b06b52baSBryan DrewerySupported unit symbols are: 65*b06b52baSBryan Drewery.Bl -tag -width indent -compact 66*b06b52baSBryan Drewery.It s 67*b06b52baSBryan Dreweryseconds 68*b06b52baSBryan Drewery.It m 69*b06b52baSBryan Dreweryminutes 70*b06b52baSBryan Drewery.It h 71*b06b52baSBryan Dreweryhours 72*b06b52baSBryan Drewery.El 730e5e4167SJilles Tjoelker.It Fl v 740e5e4167SJilles TjoelkerPrint the exit status when each process terminates. 750e5e4167SJilles Tjoelker.El 76*b06b52baSBryan Drewery.Sh EXIT STATUS 770e5e4167SJilles TjoelkerThe 780e5e4167SJilles Tjoelker.Nm 79*b06b52baSBryan Dreweryutility exits 0 on success, and >0 if an error occurs. 80*b06b52baSBryan Drewery.Pp 81*b06b52baSBryan DreweryIf the 82*b06b52baSBryan Drewery.Fl t 83*b06b52baSBryan Dreweryflag is specified and a timeout occurs, the exit status will be 124. 840e5e4167SJilles Tjoelker.Pp 850e5e4167SJilles TjoelkerInvalid pids elicit a warning message but are otherwise ignored. 860e5e4167SJilles Tjoelker.Sh SEE ALSO 870e5e4167SJilles Tjoelker.Xr kill 1 , 880e5e4167SJilles Tjoelker.Xr pkill 1 , 890e5e4167SJilles Tjoelker.Xr ps 1 , 900e5e4167SJilles Tjoelker.Xr wait 1 , 910e5e4167SJilles Tjoelker.Xr kqueue 2 920e5e4167SJilles Tjoelker.Sh NOTES 930e5e4167SJilles Tjoelker.Nm 940e5e4167SJilles Tjoelkeris not a substitute for the 950e5e4167SJilles Tjoelker.Xr wait 1 960e5e4167SJilles Tjoelkerbuiltin 970e5e4167SJilles Tjoelkeras it will not clean up any zombies or state in the parent process. 980e5e4167SJilles Tjoelker.Sh HISTORY 990e5e4167SJilles TjoelkerA 1000e5e4167SJilles Tjoelker.Nm 1010e5e4167SJilles Tjoelkercommand first appeared in SunOS 5.8. 102