begin  quoting Tracy R Reed as of Sat, Oct 01, 2005 at 10:17:39PM -0700:
> Todd Walton wrote:
[snip]
> > 5) Does 'tee' have a use?
> 
> I've never used it myself but it seems to be taught in every basic unix
> class.

It comes in to play when you want to capture the output of a pipe-sequence
part-way through. 

% ls | tee /tmp/data1 | grep -v squeak | tee /tmp/data2 | grep -v tar > 
/tmp/data3
% wc -l /tmp/data*
     32 /tmp/data1
     30 /tmp/data2
     29 /tmp/data3
     91 total
%

One way to use tee is to redirect data into a file *and* watch it as well; 
instead of

% mycommand > filename & tail -f filename

You can use tee:

% mycommand | tee filename 

-Stewar "Should do more with pipes" Stremler


-- 
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to