I have set up a number of processes in the background that need to finish processing before the next process can be started. While I've got this set up, there is one step where 2 programs need to be started at the same time, but I only need one of these to finish in order for the next steps to run. I don't need the second program to finish for the next step to start.

prog1 prog2


What I need is for prog3 to start when prog1 has finished, leaving prog2 to continue running. Is this possible? Anything I've tried is waiting for prog2 to finish processing before starting prog3.

2 Answers 2

prog2 & (prog1 ; prog3) &
prog1 &; pid1=$!; prog2 &; wait $pid1; prog3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .