Getting nohup to properly exit after running application
I have a program that runs indefinitely. I which to run this program remotely by issuing the following command:
nohup mono program.exe &
Although I'm able to close the terminal and still have program.exe running, I would like nohup to return me the command prompt ($), so that I can issue more commands before terminating.
How do I go about doing this?
Cheers
Answer (or workaround)
Do an explicit redirection of the standard output and errors streams
nohup mono program.exe >> nohup.out 2>&1 &
If you execute the command in the way described above, you will get back the command prompt.
You are executing it in the background. So, you should get back the command prompt before terminating the process program.exe. This is not the case!!!?