[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: nohup, but not nohup.out -- how to?



bob@proulx.com (Bob Proulx) writes:

> Kai Grossjohann wrote:
>> >> > 	nuhup somecommand > somefile & sleep 1; tail -f somefile
>> Oh!  Fascinating.  Does nohup look with isatty(3) to determine what it
>> should do?
>
> Yes.  It looks at file descriptors 0, 1, and 2, and redirects any that
> are a tty device.  So if you have already redirected them then nohup
> has nothing to do.  But you need to redirect the other files too.

The docs say that it is not necessary to redirect stderr;
from (coreutils)nohup invocation:

       If standard error is a terminal, it is redirected to the same file
    descriptor as the standard output.

It's interesting that the documentation of nohup does not talk about
stdin.

Kai



Reply to: