1

I'm calling another script from my bash script like so -- with an ampersand.

OtherScriptThatDoesNotExit &
echo "done"

I see it getting to "done" but I still see my original script running is ps. Any idea why this could be? (Note, I'm running on Puppy Linux)

1 Answer 1

3

The script is still waiting on the subprocess you spawned. Use nohup, disown or screen to leave a long running task in the background and get back to your shell.

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

3 Comments

Additionally, if you do need to wait for the script to finish, you can use 'wait' to pause execution until all jobs have completed.
So I just call disown in the line after OtherScriptThatDoesNotExit? Or what are the differences?
Yes, though nohup is a bit more appropriate for script usage. nohup will redirect output to a file, with disown it'll be gone

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.