If you want to start a shell script in a terminal session, and then have the script run in background mode until it finishes, you can use the Nohup command, even if you quit the terminal session. The feeling of Nohup is to initialize a process to a daemon . The nohup command runs another command to block all sighup signals sent to the process. This prevents the process from exiting when it exits the terminal session.
Because the Nohup command will disassociate the process from the terminal, the process will lose the link to stdout and stdin, and in order to save the output generated by the command, the Nohup command will automatically redirect stdout and stderr messages to a file named Nohup.out.
************************************************************************************
The demo script is as follows, very simple:
===============================================
The command format executed is:
nohup ./tmp.bash&, output will go to Nohup.out
Reprinted from: http://blog.sina.com.cn/s/blog_ac9fdc0b0101pciy.html
Shell:nohup Daemon Process