Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ wait(1) — SunOS 5.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

csh(1)

jobs(1)

ksh(1)

sh(1)

wait(1)

NAME

wait − shell built-in function to wait for other jobs or processes

SYNOPSIS

sh

wait [ n ]

wait [%jobid ...]

csh

wait [ n ]

ksh

† wait [ job ]

DESCRIPTION

sh

Wait for your background process whose process id is n and report its termination status.  If n is omitted, all your shell’s currently active background processes are waited for and the return code will be zero.  wait accepts a job identifier, when Job Control is enabled, and the argument, jobid, is preceded by a percent-sign. 

The shell itself executes wait, without creating a new process.  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 n is not an active process id, all your shell’s currently active background processes are waited for and the return code will be zero. 

csh

Wait for your background process whose process id is n and report its termination status.  If n is omitted, all your shell’s currently active background processes are waited for and the return code will be zero. 

The shell itself executes wait, without creating a new process.  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 n is not an active process id, all your shell’s currently active background processes are waited for and the return code will be zero. 

ksh

Wait for the specified job and report its termination status.  If job is not given then all currently active child processes are waited for.  The exit status from this command is that of the process waited for. 

On this man page, ksh(1) commands that are preceded by one or two † (daggers) are treated specially in the following ways:

1.  Variable assignment lists preceding the command remain in effect when the command completes. 

2.  I/O redirections are processed after variable assignments. 

3.  Errors cause a script that contains them to abort. 

4.  Words, following a command preceded by †† that are in the format of a variable assignment, are expanded with the same rules as a variable assignment.  This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. 

SEE ALSO

csh(1), jobs(1), ksh(1), sh(1)

SunOS 5.4  —  Last change: 15 Apr 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026