bash script doesnt run correctly as background process
I have bash script which works well but when I send it back with nohup script &
and close my terminal session then it's not working correctly. It only works well within my terminal session open.
What could be possible reasons 开发者_Go百科which affects my script run not correctly without my terminal session? Could it be one of the terminal variables or something?
solaris 10
call:
script &
disown $!
&
launches your script in the background and disown $!
detaches last executed command from the current shell. $!
is the PID of the last background executed command.
Without the source we can only make guesses. However, your usecase might be a good fit for using GNU Screen: http://www.gnu.org/software/screen/ You can detach shell sessions from your current login and pick them up later on.
In my humble opinion one of the most useful programs on earth ;)
精彩评论