Additions:
||-m,-atmost n||Waits until at most n jobs are running||
Deletions:
-atmost n|| Waits until at most n jobs are running||
Additions:
||-m n
-atmost n|| Waits until at most n jobs are running||
[[Commands]]
[[CategoryCommands]]
-atmost n|| Waits until at most n jobs are running||
[[Commands]]
[[CategoryCommands]]
Deletions:
-atmost n Waits until at most n jobs are running
Deletions:
No Differences
Additions:
======Command wait======
====Name====
**wait** waits for one or more background jobs to complete
====Synopsis====
wait [options ][ job ]
====Description====
Waits for all jobs to complete, a specific job to complete, or at most N outstanding jobs to be running.
===Options===
-m
-atmost n Waits until at most n jobs are running
If job arguments are given they are interpreted as job ID's and waited for individually.
If no args are given then all jobs of the current shell are waited for.
If -m or -atmost is given then waits until there at atmost "n" jobs running.
Note that jobs most be known to the current shell. waiting for "-m 10" is not a guarantee that there are at most 10 "threads" running, only that there are at most 10 "jobs invoked from the current shell" running.
sleep 10 &
wait
sleep 10 &
wait 8
Start 5 jobs then wait for 3 to complete.
for i in 10 20 30 40 50 ; do
sleep $i &
done
wait -m 2
====Name====
**wait** waits for one or more background jobs to complete
====Synopsis====
wait [options ][ job ]
====Description====
Waits for all jobs to complete, a specific job to complete, or at most N outstanding jobs to be running.
===Options===
-m
-atmost n Waits until at most n jobs are running
If job arguments are given they are interpreted as job ID's and waited for individually.
If no args are given then all jobs of the current shell are waited for.
If -m or -atmost is given then waits until there at atmost "n" jobs running.
Note that jobs most be known to the current shell. waiting for "-m 10" is not a guarantee that there are at most 10 "threads" running, only that there are at most 10 "jobs invoked from the current shell" running.
sleep 10 &
wait
sleep 10 &
wait 8
Start 5 jobs then wait for 3 to complete.
for i in 10 20 30 40 50 ; do
sleep $i &
done
wait -m 2
Deletions:
Waits for jobs to complete. If any arguments are given they are interpreted as job ID's and waited for individually.
If no args are given then all joibs of the current shell are waited for.
$ sleep 10 &
8
$ wait
$ sleep 10 &
8
$ wait 8