Bash – Getting nohup to properly exit after running application

bash

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 &

Best Answer

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!!!?