On Thu, Mar 13, 2003 at 11:11:13PM +0200, shlomo solomon wrote:
> Hi,
> 
> I spent a couple of hours looking for this, but I bet one of the bash gurus 
> can help me here ;-).
> 
> I have a script that puts a lot of output on the screen. I want to look for a 
> particular string in the output, so I pipe the output to GREP. That works 
> fine, but here's the problem. I also want to see the output on the terminal, 
> and the pipe to GREP means I only get to see the line that matches the string 
> I'm looking for - not **ALL** the screen output. Is there a way to see output 
> on the screen AND pipe it to GREP at the same time?

tee to a file

grep stdin

I also recall a "multi-cat" or "multi-pipe" file, but can't seem to find
it anywhere.

Also: can this be done using a more complicated redirection in a
standard shell?

> 
> BTW - I have a partial solution and that's to pipe to a file and then do 2 
> separate operations - cat the file to the screen and GREP the file to find 
> what I'm looking for. The problem is that I then see the output only after 
> the script has finished running - not **online**.

If you chose to go that route, you could have used 'tail -f' and view it
online.

This may be useful if you have a script that sends *lots* of output to
the terminal (espcially if it is a slow terminal), and you don't want
the pipe's buffers to limit the script.

-- 
Tzafrir Cohen
mailto:[EMAIL PROTECTED]
http://www.technion.ac.il/~tzafrir/

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to