Reputation: 3856
I'm trying to do something similar to the following:
(task1 & task2) && echo "finished task1 and task2" && task3
The goal is that task1
and task2
will be executed simultaneously, and once BOTH finished, the latter command will be executed (echo
and then task3
)
Is that possible?
Upvotes: 1
Views: 55
Reputation: 208043
Just use:
task1 &
task2 &
wait # for both task1 and task2 to finish
echo "finished task1 and task2"
task3
Upvotes: 2