[PLUG] Correct use of 'tee'

Adam L. Klein alklein at dsl-only.net
Sun Jan 15 17:55:15 PST 2006


On Sun, 2006-01-15 at 17:32 -0800, Rich Shepard wrote:
>    The man page for 'tee' is so skinny, it's emaciated. I found it useless.
> 
>    I was trying to capture the errors in a 'make' to a file called
> build_errors.log. When I tried 'make | tee build_errors.log' all I got was
> the last line on the screen. The info command was no more forthcoming.
> 
>    Finally, I found a web page with a highly convoluted command line
> (redirecting 3>&1, 1>&2, and so on) while piping various outputs through a
> couple of different invocations of 'tee.' It worked, but I had four files;
> two duplicates of what looked like the output of stdout and stderr.
> 
>    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?
> 
>    *@$%!!)^ man page!
> 
> Rich

As I discovered last week, you can also add a '-a' to tee and it will
append, rather than overwrite the file you specify.

Adam
-- 
Adam L. Klein
<alklein at dsl-only.net>




More information about the PLUG mailing list