tags:

views:

73

answers:

2

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 which affects my script run not correctly without my terminal session? Could it be one of the terminal variables or something?

solaris 10

A: 

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 ;)

markmywords
+1  A: 

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.

Arkaitz Jimenez