From owner-freebsd-questions Fri Sep 22 20:56:49 2000 Delivered-To: freebsd-questions@freebsd.org Received: from xena.gsicomp.on.ca (cr677933-a.ktchnr1.on.wave.home.com [24.42.130.87]) by hub.freebsd.org (Postfix) with ESMTP id 9819537B423 for ; Fri, 22 Sep 2000 20:56:43 -0700 (PDT) Received: from localhost (matt@localhost) by xena.gsicomp.on.ca (8.10.1/8.9.2) with SMTP id e8N3ufA71508; Fri, 22 Sep 2000 23:56:41 -0400 (EDT) (envelope-from matt@xena.gsicomp.on.ca) Date: Fri, 22 Sep 2000 23:56:41 -0400 (EDT) From: Matthew Emmerton To: rob Cc: "questions@FreeBSD.ORG" Subject: Re: "make" output redirected to file In-Reply-To: <39CBB5C4.E494B639@home.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 22 Sep 2000, rob wrote: > How do I redirect all of the screen output from make to a file? I want > to be able to capture error messages. It appears that using "make > > file" doesn't work since there are other programs involved which send > their own output to the screen. Thanks, Rob. When you do 'command > file', you only redirect output sent to 'standard output (stdout)' to the file. Since most errors are sent to 'standard error (stderr)', you need to redirect it as well. 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.) This is covered in 'man sh' or 'man ksh'. -- Matthew Emmerton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message