0

In script a I tell script b to execute a certain command. Is there a way to pause script a until script b is done executing? I don't want to use sleep, because every run of the script can be different.

1 Answer 1

1

Use:

wait <pid>

This will cause script A to wait for B to complete before continuing.

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

2 Comments

How can I catch the pid of script B in script A?
Once you have spawned the process, "echo $!" will return the pid

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.