Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Sep 2000 23:56:41 -0400 (EDT)
From:      Matthew Emmerton <matt@gsicomp.on.ca>
To:        rob <europax@home.com>
Cc:        "questions@FreeBSD.ORG" <questions@FreeBSD.ORG>
Subject:   Re: "make" output redirected to file
Message-ID:  <Pine.BSF.3.96.1000922235425.71499B-100000@xena.gsicomp.on.ca>
In-Reply-To: <39CBB5C4.E494B639@home.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.1000922235425.71499B-100000>