Search code examples
stdouttee

stdout to multiple processes - Windows


Very similar to: How can I send the stdout of one process to multiple processes using (preferably unnamed) pipes in Unix (or Windows)?

Particularly...

         proc2 -> stdout
       /
 proc1
       \ 
         proc3 -> stdout

I have 'proc1' with some output that I would like to pass in to 'proc2' and 'proc3'.
I would not like to save the output from 'proc1' and pass that in [as the input] to two other processes, 'proc2' and 'proc3'.

There was a lot of discussion about 'tee' and I found 'wtee'.
Alas, the following did not work:

proc1 | wtee (proc2 -i - <other arguments>) (proc3 -i - <other arguments>)

Note: The '-i -' is passed in to 'proc2' and 'proc3' so that each process knows where the input is coming from (stdout).

Is there a way I can do what I am trying to do in Windows?
Perhaps the arguments passed in to each process is why the two are not working?
Am I better off [or stuck] writing a program to do this?


Solution

  • I solved the issue by making my own pipe reader/server similar to this, except the server can output to as many clients as it chooses.