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

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



%% Kai Grossjohann <kai@emptydomain.de> writes:

  kg> Maurits van Rees <maurits@vanrees.org> writes:
  >> On Fri, Sep 02, 2005 at 02:03:15PM +0200, Kai Grossjohann wrote:
  >>> David Jardine <david@jardine.de> writes:
  >>> 
  >>> > 	nuhup somecommand > somefile & sleep 1; tail -f somefile
  >>> 
  >>> That will write "nohup: appending output to `nohup.out'" to the file
  >>> somefile :-)
  >>> 
  >>> The output from somecommand will still end up in nohup.out.
  >> 
  >> No it won't.  At least not on my system for a simple command like
  >> 'ls':

  kg> Oh!  Fascinating.  Does nohup look with isatty(3) to determine
  kg> what it should do?

It must.  I always use this:

    nohup somecommand > somefile 2>&1 &

to run builds, etc.  Or, if you're using bash you can use:

    nohup somecommand &> somefile &

which makes it a little shorter.

I can't tell you how many times I've been glad that I had stderr in the
output file as well!! :-).

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@nortel.com>           HASMAT--HA Software Mthds & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
        These are my opinions--Nortel takes no responsibility for them.



Reply to: