1

I have the following requirement where there are 3 scripts say, a2,a3,a4

Now as per the requirement a2,a3 should be executed parallely and a4 sequentially.(ie., a4 should be executed only after the completion of a2&a3).

Now I tried this like,

((((echo 'start a2' `date`; nohup a2; echo 'end a2') >>log) &)
(((echo 'start a3'; nohup a3; echo 'end a3') >>log) &)  &&
(echo 'start a4';nohup a4; echo 'end a4') >>log)

assuming a2,a3 are send to the background by the '&' and a4 executes only after a2,a3 because of '&&' why doesn't this work?.(a4 executes before a3.I tried this by introducing delays in the scripts with sleep command) How should I go about writing this?. Thanks in advance.

1 Answer 1

1

You need to wait for a2 and a3 to complete before you run a4. So look at the manual page for the wait command.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.