wait Command Purpose Waits until the termination of a process ID. Syntax wait [ ProcessID ... ] Description The wait command waits (pauses execution) until the process ID specified by the ProcessID variable terminates. If the ProcessID variable is not specified, the wait command waits until all pro- cess IDs known to the invoking shell have terminated and exit with a 0 exit status. If a ProcessID variable represents an unk- nown process ID, the wait command treats them as known process IDs that exited with exit status 127. The wait command exits with the exit status of the last process ID specified by the ProcessID variable. Flags ProcessID Specifies an unsigned decimal integer process ID of a command, which the wait command waits on until termination. Exit Status If one or more operands were specified, all of the operands ter- minated or were not known by the invoking shell, and the status of the last operand specified is known, then the exit status of the wait command is the same as the exit status information of the command indicated by the last operand specified. If the pro- cess terminated abnormally due to the receipt of a signal, then the exit status is greater than 128 and distinct from the exit status information generated by other signals, although the exact status value is unspecified (see the kill -l command option). Otherwise, the wait command exits with one of the following values: 0 The wait command was invoked with no operands and all process IDs known by the invoking shell have terminated. 1-126 The wait command detected an error. 127 The command identified by the last ProcessID operand speci- fied is unknown. Implementation Specifics This command is part of Base Operating System (BOS) Runtime. Files /usr/bin/wait The file that contains the wait command. Related Information Shells Overview in AIX Version 3.2 System User's Guide: Base and Devices. The shutdown command, sleep command, wall command. The alarm subroutine, pause subroutine, sigaction subroutine.