I have two processes which I need to connect like this:

proc1 -- sends output to proc2 proc2 -- sends output to proc1

So far, all pipe examples are of this kind: proc1 | proc2

That's nice, but how do I make the output of proc2 go to proc1?

A bash example would be nice. A Windows shell example would be great :)

Thanks in advance, Adrian.

Adding more details:

The system is expected to work as client-server system in which the client works with the server in a request-response interaction model. The interaction ends when the client has no more requests.

Interaction example: client: request1; server: response1; client: request2; server: response2; . . . . client: closeRequest; server: closeApproved;

At this point the server exits following a client exit. End of example.

It seems that a solution like (assuming pipe is available) client < pipe | server > pipe would not work (please correct me) because in this arrangement the client produces one big request, the shell pipes this big request to the server, then the server produces one big response, and finally the shell pipes this big response to the client.

Edit
Report