PWAIT(1) General Commands Manual PWAIT(1)

pwait
wait for processes to terminate

pwait [-isv] [-t timeout] pid ...

The pwait utility will wait until each of the given processes has terminated.

The following option is available:

Don't wait for all the processes, exit after the first process or group of processes exit.
Exit with the status code of the first non-zero exit status pid, or if timed out exit with 255.
timeout
Only wait for timeout seconds before exiting.
Print the exit status when each process terminates.

The pwait utility returns 0 on success, and >0 if an error occurs.

Invalid pids elicit a warning message but are otherwise ignored.

kill(1), pkill(1), ps(1), wait(1), kqueue(2)

pwait is not a substitute for the wait(1) builtin as it will not clean up any zombies or state in the parent process.

A pwait command first appeared in SunOS 5.8.
March 4, 2015 NetBSD 9.4