[PLUG] Correct use of 'tee'

Brian Harring ferringb at gentoo.org
Sun Jan 15 22:09:28 PST 2006

On Sun, Jan 15, 2006 at 06:12:20PM -0800, Fedor Pikus wrote:
> On 1/15/06, Rich Shepard <rshepard at appl-ecosys.com> wrote:
> >    I guess that what I was getting was the output to stderr going to the
> > file.
> > But, I even tried 'make 2>&1 | tee build_errors.log', but that didn't work
> > either. Should I be re-directing 1>&2 and sending that to the file with
> > tee?
> make 2>&1 | tee log

Agreed, should work, wondering about the shell in use and what he's 

> although I believe the redirects apply only to make itself and not the
> programs it launches (may be it applies to programs directly launched from
> make, but after several levels of indirection redirects are lost for sure).
> In csh there is no way to do this.

Redirects are still going to be there.  Redirect is just the shell 
dup'ing file handles around a bit, prior to exec'ing- all children of 
the process will inherit the fd's the make process has open at 0,1,2 
(stdin,stdout,stderr)- this is exempting if it goes and switches the 
handles around on it's own, dumping to a log for example.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.pdxlinux.org/pipermail/plug/attachments/20060115/c6cba344/attachment.sig>

More information about the PLUG mailing list