- One of the following:
- The unsigned decimal integer process ID of a command, for which the utility is to wait for the termination.
- A job control job ID (see the Base Definitions volume of POSIX.1‐2008, Section 3.204, Job Control Job ID) that identifies a background process group to be waited for. The job control job ID notation is applicable only for invocations of wait in the current shell execution environment; see Section 2.12, Shell Execution Environment. The exit status of wait shall be determined by the last command in the pipeline.
- The job control job ID type of pid is only available on systems supporting the User Portability Utilities option.
- Provide a default value for the internationalization variables that are unset or null. (See the Base Definitions volume of POSIX.1‐2008, Section 8.2, Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.)
- If set to a non-empty string value, override the values of all the other internationalization variables.
- Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments).
- Determine the location of message catalogs for the processing of LC_MESSAGES.
- The wait utility was invoked with no operands and all process IDs known by the invoking shell have terminated.
- The wait utility detected an error.
- The command identified by the last pid operand specified is unknown.
(wait) nohup wait ... find . −exec wait ... \;
j1& p1=$! j2& wait $p1 echo Job 1 exited with status $? wait $! echo Job 2 exited with status $?
sleep 1000& pid=$! kill −kill $pid wait $pid echo $pid was terminated by a SIG$(kill −l $?) signal.
sleep 257 | sleep 31 & jobs −l %%
wait <pid of sleep 31> wait %%
while sleep 60 do job& echo Job started $(date) as $! done