Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bi-directional pipe



On Jun 11,  5:06pm, Vincent Lefevre wrote:
} Subject: Re: Bi-directional pipe
}
} Could you give an example?

A correct one?  No.

} I'd say that's a bug in the command that starts the bidirectional
} pipe.

Exactly.

Note that we're not really talking about "a bidirectional pipe" here.
We're talking about a loop in a pipeline -- there are two pipes, each
from a stdout to a stdin.  It's only "bi"-directional because there
are only two processes in the loop.

} I don't see how commands like grep could do anything.

You mean, why would anyone even think of connecting two programs this
way?  Side effects.  Consider tee, the "w" command in sed, or anything
that produces stderr output that might be interesting.

More likely, though, is that someone writes a new program expecting it
to work in such a loop, but without thinking through the consequences.



Messages sorted by: Reverse Date, Date, Thread, Author