From owner-freebsd-questions Sat Sep 23 17: 4:43 2000 Delivered-To: freebsd-questions@freebsd.org Received: from femail2.sdc1.sfba.home.com (femail2.sdc1.sfba.home.com [24.0.95.82]) by hub.freebsd.org (Postfix) with ESMTP id 98B4737B424 for ; Sat, 23 Sep 2000 17:04:41 -0700 (PDT) Received: from home.com ([24.12.186.185]) by femail2.sdc1.sfba.home.com (InterMail vM.4.01.03.00 201-229-121) with ESMTP id <20000924000434.XXUG27630.femail2.sdc1.sfba.home.com@home.com>; Sat, 23 Sep 2000 17:04:34 -0700 Message-ID: <39CCE2BF.50DCE82@home.com> Date: Sat, 23 Sep 2000 17:05:03 +0000 From: rob X-Mailer: Mozilla 4.74 [en] (X11; U; FreeBSD 4.1-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: dima@unixfreak.org Cc: "David J. Kanter" , "questions@FreeBSD.ORG" Subject: Re: "make" output redirected to file References: <20000923052744.831821F1E@static.unixfreak.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 > 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