On 2/9/11 12:40 PM, McKown, John wrote:
> tee can output to multiple files? The man page implies only a single file.

Hmmm...maybe you need a new enough tee also:

SYNOPSIS
       tee [OPTION]... [FILE]...

DESCRIPTION
       Copy standard input to each FILE, and also to standard output.


> So I guess I could:
>
> bzcat data*bz2| tee >(perl script1.pl|psql database)|perl script2.pl|psql 
> database
>
> bzcat data*bz2| tee >(perl script1.pl|psql database)|tee >(pers 
> script2.pl|psql database)|perl script3.pl|psql databaselin

Yep, those should work also. The named pipe would work too, if you did 
something like:

mkfifo p1 p2 p3

bzcat data*bz2 | tee p1 | tee p2 > p3 &

perl script1.pl < p1
perl script2.pl < p2
perl script3.pl < p3

(make sure and background or run in another terminal the bzcat.)
> for the 2 case. I also guess that I might be able to cascade tee processes. 
> But that's getting nasty, too.
>
> --
> John McKown
> Systems Engineer IV
> IT

- Larry

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to lists...@vm.marist.edu with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to