Daniyal
Daniyal

Reputation: 149

Run bash script from another script and exit first script while second is running

First bash script is:

./second #takes too long

I want kill first bash script while second bash script is still running.

Can I do that?

UPDATE

First script run by cronjob!

Upvotes: 9

Views: 8574

Answers (1)

glenn jackman
glenn jackman

Reputation: 246744

If the last thing that the first script does is to call the second script, then do this:

exec ./second

which replaces the first script's process with the second.

otherwise

nohup ./second &
disown

Upvotes: 15

Related Questions