Can a Bourn Shell Script put itself in the background?

Nikos Vassiliadis nvass9573 at
Thu Jun 4 14:29:50 UTC 2009

Martin McCormick wrote:
> 	So, can I make a shell script background itself after
> starting?

You could run all your code in a sub-shell:
	#your script here
) &

or in a shell function:
	#your script here

old_script $* &

Perhaps the second way requires less code


More information about the freebsd-questions mailing list