[PLUG] Correct use of 'tee'

Rich Burroughs rich at paranoid.org
Mon Jan 16 17:15:50 UTC 2006


David Fleck wrote:

> Except that programs often send warnings and informational messages to 
> stderr, not stdout. 'tee' won't capture stderr unless it's redirected to 
> stdout.

Right.

tee is a great tool, Rich, it's a good one to learn. It's very handy at 
times to be able to see stdout and also grab it to a file and tee makes 
that very easy.

One question, as you're troubleshooting, is whether tee is even broken. 
It may be working as designed, or there may be something else broken in 
your environment.

One interesting comparison would be to run the command and send stdout 
and stderr out to a file without using tee, then compare and see if you 
get a different result when you use tee. You could do it to two 
different output filenames and diff them.

I don't generally redirect stderr when I use tee so I'm not positive of 
the syntax. I just use tee as a quick and dirty way to grab stdout while 
I watch it. As with most *nix things, there are a lot of different ways 
to do all of this :)

I did see this page, which you may have already seen:

http://www.cpqlinux.com/redirect.html


Rich




More information about the PLUG mailing list