This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
commands:builtin:wait [2013/04/14 11:41]
thebonsai [Description]
commands:builtin:wait [2020/06/28 06:56] (current)
thebonsai [Table]
Line 2: Line 2:
 ===== Synopsis ===== ===== Synopsis =====
-<​code>​wait [ID]</​code>​+<​code>​wait ​[-f] [-n] [-p VARNAME] ​[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) +
-  * wait for "the next" job (''​-n''​ option)+
 +  * 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 ====
-^Option^Description^ +^ Option ​         ^ Description ​                                                                                                                       
-|''​-n'' ​ |Waits for "the next" child to exit (as opposed to "all children"​ without this option) ​- since 4.3-alpha |+| ''​-n'' ​         | Waits for "the next" child to exit (as opposed to "all children"​ without this option). ​Accepts a list of IDs (jobs) ​               | 
 +| ''​-f'' ​         | Waits for the termination of the given ''​ID''​ (instead of waiting for a status change only)                                        | 
 +| ''​-p VARNAME'' ​ | When waiting for a list (-n) or all jobs, writes the job ID to the job that was actually terminated into the variable ''​VARNAME''  ​|
 ==== Return status ==== ==== Return status ====
  • commands/builtin/wait.1365939688.txt
  • Last modified: 2013/04/14 11:41
  • by thebonsai