macports with closed stdout
René J.V. Bertin
rjvbertin at gmail.com
Tue May 5 12:51:19 PDT 2015
On Tuesday May 05 2015 13:44:42 Eric A. Borisch wrote:
> Here's the (bash) you're looking for:
>
> nohup [your command here] &> outputs.log < /dev/null &
Thanks, this much I've mastered since the couple of lives ago mentioned in an earlier email ;)
nohup isn't very important anymore because it's even longer ago since I saw a process getting a SIGHUP when started in or pushed to the background. /usr/bin/nohup takes care of the output redirection, though; I'd hope that the shell builtin would do something similar but apparently it doesn't (at least not the tcsh version).
I've found the code I wrote back in the day. Its main purpose was to provide a log window facility with any kind of windowed terminal emulator (`xterm -e xpipe -fd in,out`) but it contains a protection against closing of the window (a SIGHUP/SIGKILL/SIGINT handler calling freopen(stdout,"/dev/null") etc). But of course if shouldn't be too hard to rewrite nohup so that it does what I'm looking for.
R
More information about the macports-dev
mailing list