From owner-freebsd-questions Fri Sep 22 22:27:48 2000 Delivered-To: freebsd-questions@freebsd.org Received: from static.unixfreak.org (static.unixfreak.org [63.198.170.139]) by hub.freebsd.org (Postfix) with ESMTP id BA2C037B422 for ; Fri, 22 Sep 2000 22:27:44 -0700 (PDT) Received: by static.unixfreak.org (Postfix, from userid 1000) id 831821F1E; Fri, 22 Sep 2000 22:27:44 -0700 (PDT) Subject: Re: "make" output redirected to file In-Reply-To: <20000923002313.A47384@freebsd.mindspring.com> from "David J. Kanter" at "Sep 23, 2000 00:23:13 am" To: "David J. Kanter" Date: Fri, 22 Sep 2000 22:27:44 -0700 (PDT) Cc: "questions@FreeBSD.ORG" From: Dima Dorfman Reply-To: dima@unixfreak.org X-Mailer: ELM [version 2.4ME+ PL61 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20000923052744.831821F1E@static.unixfreak.org> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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