Since I'm new to Linux, apologies if I'm not using the correct terminology.
I'm trying to run a number of tasks in parallel (using the background shell operator). However, I need to first run two tasks in parallel followed (only after completion) by the rest of the tasks that depend on the outcome of the first two.
For example, suppose tasks
A.2 can run in parallel (no dependency between them) and produce some files that will be used by tasks
B.3. All the
B tasks are independent; however, they cannot start until
A.2 finish in order to see the files. With this in mind, I came up with the following shell scripts:
script1 has the following lines:
./A.1 & ./A.2 &
script2 has the following lines:
./B.1 & ./B.2 & ./B.3 &
script3 simply calls scripts 1 and 2 sequentially (i.e., without the
& operator) as follows:
I'm not sure if
script3 is what I'm looking for. Am I doing it right? In other words, will
script2 wait until
script1 finishes and then starts?