DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

wait(1)


wait -- await completion of process

Synopsis

/usr/bin/wait [pid . . .]

Description

This shell script executes the builtin command of the same name as implemented by the /u95/bin/sh shell. See ksh(1) for more information on this shell.

Wait for your background processes whose process IDs are the values of pid and report termination status. Any pid which represents an unknown process ID is treated as if it were a known process ID that exited with exit status 127.

If pid is omitted, all your shell's currently active background processes are waited for.

The shell itself executes wait, without creating a new process.

Exit status

wait exits with an exit status determined as follows.

If wait is invoked with one or more pid arguments, and the processes of all the given pids have terminated or are not known to the invoking shell, and the status of the last pid is known, then the exit status is that of the last pid.

If wait terminated abnormally due to the receipt of a signal, the exit status is greater than 128.

Otherwise, wait exits with one of the following values:


0
wait was invoked with no operands and all process IDs known by the invoking shell have terminated.

1-126
wait detected an error.

127
The process identified by the last pid operand given is unknown.

Files


/usr/lib/locale/locale/LC_MESSAGES/uxcore.abi
language-specific message file. (See LANG on environ(5)).

References

ksh(1)

Notices

If you get the error message cannot fork, too many processes, try using the wait command to clean up your background processes. If this doesn't help, the system process table is probably full or you have too many active foreground processes. (There is a limit to the number of process ids associated with your login, and to the number the system can keep track of.)

Not all the processes of a 3- or more-stage pipeline are children of the shell, and thus cannot be waited for.

If pid is not an active process id, wait returns immediately.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004