I'm trying to get my #!/bin/sh shell script to start another application without pausing execution. That is I'm looking for a way to launch it in the background and have my shell script keep executing. I want it to work somethi开发者_StackOverflow中文版ng like this:
# start daemon
start(){
success=`launch '/path/to/daemon'`
if [ $success != false ];then
echo 'daemon is now running'
fi
I'm also new to shell scripting so will the above (if launch existed) get the return of launch or the stdout set as $success?
I want to only use SH not BASH.
Use '&' sign after program name to launch it in background. Putting a program in the background
use NOHUP. http://en.wikipedia.org/wiki/Nohup and send output to log using >> mylogfilename
精彩评论