would do the trick. fork() generates a child process and returns 0 to it, but its PID to the parent process, so that the above line executes exit() in the parent - which is connected to the terminal - and doesn't executes it in the child process - which will then run in the background.fork && exit;
In reply to Re: How to run a process in background?
by mscharrer
in thread How to run a process in background?
by advait
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |