LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Using stdout for more than one task (https://www.linuxquestions.org/questions/programming-9/using-stdout-for-more-than-one-task-736841/)

elfoozo 06-30-2009 11:04 PM

Using stdout for more than one task
 
Hoping the title is accurate. I'm not sure what the right term is.

I want to parse my mail log file and reuse the results but I'm having a hard time structuring the syntax. Something like:

Code:

grep hostname /var/log/mail.log | \
  grep NOQUEUE: | \
  sed -e 's/hostname postfix\/smtpd/[[0-9]*\]: //g'

at this point I want to redirect what I have in hand to a file but also ... fork? or split? whatever the term, to continue onward so that I can pipe the results further into wc -l or sort or programX... without having to re-loop through that huge log file.

Is this technique possible, what is it called or how might you do it?

Sergei Steshenko 06-30-2009 11:32 PM

man tee

?

elfoozo 06-30-2009 11:36 PM

Yes, that could work. Never noticed that command before so thanks!


All times are GMT -5. The time now is 02:33 PM.