Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Sep 2000 17:05:03 +0000
From:      rob <europax@home.com>
To:        dima@unixfreak.org
Cc:        "David J. Kanter" <david.kanter@mindspring.com>, "questions@FreeBSD.ORG" <questions@FreeBSD.ORG>
Subject:   Re: "make" output redirected to file
Message-ID:  <39CCE2BF.50DCE82@home.com>
References:  <20000923052744.831821F1E@static.unixfreak.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Dima Dorfman wrote:
> 
> > On Fri, Sep 22, 2000 at 11:56:41PM -0400, Matthew Emmerton wrote:
> > > If you're using ksh or sh as your shell, executing 'command 2>&1 > file'
> > > works well.  (The logic here is this:  2>&1 says to redirect file handle 2
> > > (stderr) to file handle 1 (stdout), which is then redirected to file.)
> > ---end quoted text---
> >
> > I think it's the other way around (i.e., 2 is stdout and 1 is
> > stderr).
> 
> Nope, Matthew was correct.  From unistd.h:
> 
> #define  STDIN_FILENO   0       /* standard input file descriptor */
> #define STDOUT_FILENO   1       /* standard output file descriptor */
> #define STDERR_FILENO   2       /* standard error file descriptor */
> 
> And just in case the originator is using csh, the syntax there would
> be: `make >& file`
> 
> --
> Dima Dorfman <dima@unixfreak.org>
> Finger dima@unixfreak.org for my public PGP key.
> 
> "Never understimate the power of human stupidity."
>         -- Robert A. Heinlein
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message

Thanks to all who answered.  Now that I understand about the standard
error, I was able to find the answer in "Learning the Bash Shell". 
command 2>&1 file

Rob.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39CCE2BF.50DCE82>