I have three shell scripts say A, B and C. I need to run A in the background and run B in the background till A finishes its execution in the background. Similarly run C in the foreground till A and B finish their execution.
I was doing this for 2 processes earlier in this way.
./A.sh &
while ps -p $! >/dev/null; do
./B.sh
done
I need to run B in background and C in foreground till A finishes its execution in background. How do I modify the above code.
This will run A & B in the background with C in the foreground; B&C will loop until A finishes:
Example from my box:
What about forking
AandBat the same time, but put A second so$!givesA‘s pid:Heres an example from my box: