IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2011-01-31T12:49:26Z by ishields
2 Posts

Pinned topic one stdout into multiple stdout

‏2011-01-20T09:37:02Z |
is it possible to redirect std-out into multiple st-dins?

#!/bin/sh   echo 
'transfered data summary:' nice -n19 bzcat *.bz2 |\ nice -n19 grep /przykl |\ nice -n19 uniq |\ nice -n19 awk 
'BEGIN {FS="\""} {print $3}' |\ nice -n19 awk 
'BEGIN {FS=" "} {print $2}' |\ nice -n19 awk 
'{ suma+=$0 } { print suma }' |\ nice -n19 tail -n 1   echo 
'File request count:' nice -n19 bzcat *.bz2 |\ nice -n19 grep /przykl |\ nice -n19 uniq |\ nice -n19 wc -l   echo 

Files are huge logs (gigabytes) and i don't want to save any data during this process into files just display results.
and I want to execute this operation just once:

nice -n19 bzcat *.bz2 |\ nice -n19 grep /przykl |\ nice -n19 uniq |\

and redirect it's out into two inputs (wc and awk)

Is it possible and how?
Can someone give me an example?
Updated on 2011-01-31T12:49:26Z at 2011-01-31T12:49:26Z by ishields