Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
commands:builtin:wait [2012/10/20 17:36] thebonsai [Exit status] |
commands:builtin:wait [2018/07/12 07:36] (current) thebonsai |
||
---|---|---|---|
Line 2: | Line 2: | ||
===== Synopsis ===== | ===== Synopsis ===== | ||
- | <code>wait [ID]</code> | + | <code>wait [-f] [-n] [ID...]</code> |
===== Description ===== | ===== Description ===== | ||
- | The ''wait'' builtin command is used to | + | The ''wait'' builtin command is used to wait for job completion and return exit status. |
- | * wait for a specific job (asynchronous command) and report its exit status if the ''ID'' is given | + | |
- | * wait for all running jobs (asynchronous commands) | + | * if ''ID'' is a job specification, it waits for all processes in the pipeline of this job |
+ | * waits for a specific job (asynchronous command) and report its exit status if one or more ''ID'' is given | ||
+ | * waits for all running jobs (asynchronous commands) | ||
+ | * waits for "the next" job (''-n'' option) | ||
+ | * waits for termination instead of status change (''-f'' option) | ||
+ | |||
+ | ''ID'' may be an operating system process identifier or a shell job specification. | ||
==== Options ==== | ==== Options ==== | ||
- | There are no options. | + | ^Option^Description^ |
+ | |''-n'' |Waits for "the next" child to exit (as opposed to "all children" without this option) | | ||
+ | |''-f'' |Waits for the termination of the given ''ID'' (instead of waiting for a status change only) | | ||
==== Return status ==== | ==== Return status ==== |