开发者

need a script which will invoke other process/script and exit, but the invoked process should continue running

开发者 https://www.devze.com 2023-01-04 23:24 出处:网络
I\'m trying to run a script, which internally invokes other script but, the main script should exit after invoking and the invoked script should run independently on the background.

I'm trying to run a script, which internally invokes other script

but, the main script should exit after invoking and the invoked script should run independently on the background.

How can i achieve this in shell scripting? or is there any other a开发者_运维知识库lternative way to do this?

Regrads, senny


nohup otherscript &

The nohup will ensure that the process keeps running even if the current terminal goes away (for example if you close the window).

(Just to make it clear: the "&" puts the other script in the background, which means the first will keep running, and the second script won't exit when the first one does.)


If your script is in Perl, use exec() command to start the second script. exec() returns immediately after executing the command, and the calling script can exit, while the second script keeps running.

http://perl.about.com/od/programmingperl/qt/perlexecsystem.htm

0

精彩评论

暂无评论...
验证码 换一张
取 消