tee - stdout to multiple processes - Windows -


very similar to: how can send stdout of 1 process multiple processes using (preferably unnamed) pipes in unix (or windows)?

particularly...

         proc2 -> stdout        /  proc1        \           proc3 -> stdout 

i have 'proc1' output pass in 'proc2' , 'proc3'.
not save output 'proc1' , pass in [as input] 2 other processes, 'proc2' , 'proc3'.

there lot of discussion 'tee' , found 'wtee'.
alas, following did not work:

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

note: '-i -' passed in 'proc2' , 'proc3' each process knows input coming (stdout).

is there way can trying in windows?
perhaps arguments passed in each process why 2 not working?
better off [or stuck] writing program this?

i have not tested this, should able named pipes. write vbscript called splitter.vbs reads stdin , writes 2 named pipes, start 2 other processes telling them read pipes.

proc1 | cscript /nologo splitter.vbs  proc2 -i \\.\pipe\p1 proc3 -i \\.\pipe\p2 

depending on whether want programs start in new windows or not, can either start 3 command prompt windows , run 1 in each, or re-use single command prompt window using start /b

splitter.vbs this:

set fso = createobject ("scripting.filesystemobject")  set p1 = fs.createtextfile("\\.\pipe\p1”, true)    set p2 = fs.createtextfile("\\.\pipe\p2”, true)   while not wscript.stdin.atendofstream    line  = wscript.stdin.readline()    p1.writeline(line)    p2.writeline(line) loop 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -