Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 May 2000 10:57:37 -0400 (EDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        James A Wilde <james.wilde@tbv.se>
Cc:        FreeBSD Questions <freebsd-questions@FreeBSD.ORG>
Subject:   RE: Redirection
Message-ID:  <20000518145653.SMTD22611.mail.rdc1.va.home.com@john.baldwin.cx>
In-Reply-To: <003e01bfc0c9$11544c80$8c0aa8c0@hk.tbv.se>

next in thread | previous in thread | raw e-mail | index | archive | help

On 18-May-00 James A Wilde wrote:
> A quick clarification first:  Root's default shell is the Bourne shell, sh.
> User's default shell is csh.  And presumably when User su's, his shell
> becomes the Bourne shell.  The machine is running 3.1, btw.  (Does anyone
> know if it is the same on Solaris 7?)
> 
> Almost all I do on the machine has to be done as root, so we are talking
> Bourne shell.  I'd like a simple formula for sending stdout and stderr to a
> file when I run make.  The man page has me totally confused.  In other
> words:
> 
> command [some incantation involving 12&> and a filename, possibly with |]
> 
> which lets me see what's going on on the screen and save the same stuff to a
> file.
> 
> TIA
> 
> mvh/regards
> 
> James

# make > output.log 2>&1

This redirects stdout to 'output.log', and then redirects stderr (file
descriptor #2) to stdout (file descriptor #1) which is already being
sent to output.log.  If you wanted the errors to go to a seperate file,
you could do this:

# make > output.log 2> error.log

HTH

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/


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?20000518145653.SMTD22611.mail.rdc1.va.home.com>