Afficher un message
Vieux 22/08/2006, 09h12   #4
Stephane Chazelas
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Starting programs with mutually interconnected stdin/stdout

On Mon, 21 Aug 2006 20:56:04 -0000, John DuBois wrote:
> In article <ecd0pv$f0s$1@mrazik2.dkm.cz>, AlesD <ales_d@seznam.cz> wrote:
>> is there way to start programs foo and bar such that foo's stdout
>>goes to bar stdin and bar's stdout goes to stdin?

>
> In ksh:
>
> foo |&
>
> bar <&p >&p

[...]

And in zsh:

coproc foo
bar <&p >&p

|& in zsh is the same as in csh/tcsh: pipe both stdout and
stderr in foo |& bar.

Portable solution is to use named pipes:

mkfifo other-way-round
foo < other-way-round | bar > other-way-round

Beware of deadlocks

--
Stephane
  Réponse avec citation
 
Page generated in 0,06457 seconds with 9 queries