Wait
Encyclopedia
In computing
,
which pauses until execution of a background process
has ended.
where n is the pid
or job ID of a currently executing background process (job). If n is not given, the command waits until all jobs known to the invoking shell have terminated.
wait normally returns the exit status
of the last job which terminated. It may also return 127 in the event that n specifies a non-existent job or zero if there were no jobs to wait for.
Because
.
The following example will fetch the src/ directory from a machine named iona using rsync
and simultaneously update the libraries on which this program depends, before building the combination.
Wait for specified job control id number:
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...
,
wait
is a commandCommand (computing)
In computing, a command is a directive to a computer program acting as an interpreter of some kind, in order to perform a specific task. Most commonly a command is a directive to some kind of command line interface, such as a shell....
which pauses until execution of a background process
Background (computer software)
A background process is a computer process that runs "behind the scenes" and without user intervention. Typical tasks for these processes include logging, system monitoring, scheduling, and user notification....
has ended.
Usage
where n is the pid
Process identifier
In computing, the process identifier is a number used by most operating system kernels to uniquely identify a process...
or job ID of a currently executing background process (job). If n is not given, the command waits until all jobs known to the invoking shell have terminated.
wait normally returns the exit status
Exit status
The exit status or return code of a process in computer programming is a small number passed from a child process to a parent process when it has finished executing a specific procedure or delegated task...
of the last job which terminated. It may also return 127 in the event that n specifies a non-existent job or zero if there were no jobs to wait for.
Because
wait
needs to be aware of the job table of the current shell execution environment, it is usually implemented as a shell builtinShell builtin
In computing, a shell builtin is a command or a function, called from a shell, that is executed directly in the shell itself, instead of an external executable program which the shell would load and execute....
.
Example
This command can be useful where part of a script can execute in parallel to implement a barrier where an upcoming section depends on the successful completion of the preceding sections.The following example will fetch the src/ directory from a machine named iona using rsync
Rsync
rsync is a software application and network protocol for Unix-like and Windows systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar...
and simultaneously update the libraries on which this program depends, before building the combination.
Wait for specified job control id number: