Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 04 Jun 2009 17:28:19 +0300
From:      Nikos Vassiliadis <nvass9573@gmx.com>
To:        Martin McCormick <martin@dc.cis.okstate.edu>, questions@freebsd.org
Subject:   Re: Can a Bourn Shell Script put itself in the background?
Message-ID:  <4A27DA03.1060400@gmx.com>
In-Reply-To: <200906041406.n54E6Fts006668@dc.cis.okstate.edu>
References:  <200906041406.n54E6Fts006668@dc.cis.okstate.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Martin McCormick wrote:
> 	So, can I make a shell script background itself after
> starting?

You could run all your code in a sub-shell:
#!/bin/sh
(
	#your script here
) &

or in a shell function:
old_script()
{
	#your script here
}

old_script $* &

Perhaps the second way requires less code
re-factoring...

Nikos



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A27DA03.1060400>