Reputation: 29109
I want to execute cmdA
, cmdB
and cmdC
in parallel before cmdD
. This is what I have so far:
$> (cmdA & cmdB & cmdC) && cmdD
As long as cmdC
finished last this works, but, for example, if cmdC
finishes first, cmdD
is executed right away. So, my question is, how can I wait for all three commands befofe executing cmdD
? Is this possible with just &&
and &
?
Upvotes: 1
Views: 68
Reputation: 140930
how can I wait for all three commands befofe executing cmdD?
Use wait
.
(cmdA & cmdB & cmdC ; wait) ; cmdD
Upvotes: 2