<div dir="ltr">Some of the posts in this thread confuse pipes in UNIX shells (the | symbol) with the pipe system call.<div><br></div><div>In the shell, how two processes can be connected with a pipe is very constrained (only one unidirectional pipe). But the pipe system call can be used to build much more elaborate connections. Back in 1980, when I was still at Bell Labs, I wrote a shell called 2dsh ("two dimensional shell) that had a more complex syntax. The memo I wrote, "2DSH—An experimental shell for connecting processes with multiple data streams", wasn't published externally, but exists as a Bell Labs memo. I found a reference here: <a href="https://scholar.google.com/scholar_lookup?title=2DSH%E2%80%94An+experimental+shell+for+connecting+processes+with+multiple+data+streams&author=M.+J.+Rochkind&publication_year=1980">https://scholar.google.com/scholar_lookup?title=2DSH%E2%80%94An+experimental+shell+for+connecting+processes+with+multiple+data+streams&author=M.+J.+Rochkind&publication_year=1980</a>.</div><div><br></div><div>Here are two examples from that memo:</div><div><img src="cid:ii_m4bun06q0" alt="image.png" width="562" height="461"><br><div><br></div><div>I stumbled across another paper from 2017 titled "Extending Unix Pipelines to DAGs," which references my un-published Bell Labs memo. I haven't read it since I don't subscribe to IEEE Transactions on Computers.<br><div><br></div><div>A while ago Doug McIlroy was kind enough to send me a scan of my memo, but I don't think I'm allowed to publish it here. In that memo, I credit Doug for coming with a very similar idea around the same time ("A Notation for Arboreal Plumbing").</div></div></div><div><br></div><div>Marc Rochkind</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Dec 5, 2024 at 2:13 PM Dan Cross <<a href="mailto:crossd@gmail.com">crossd@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Dec 5, 2024 at 3:56 PM <<a href="mailto:arnold@skeeve.com" target="_blank">arnold@skeeve.com</a>> wrote:<br>
> Chet Ramey via TUHS <<a href="mailto:tuhs@tuhs.org" target="_blank">tuhs@tuhs.org</a>> wrote:<br>
> > On 12/5/24 10:19 AM, Dan Cross wrote:<br>
> ><br>
> > > Unix pipelines, on the other hand, tend to be used in a manner that is<br>
> > > strictly linear, without the fan-out and fan-in capabilities described<br>
> > > by Morrison. Of course, nothing prevents one from building a<br>
> > > Morrison-style "network" from Unix processes and pipes, though it's<br>
> > > hard to see how that would work without something like `select`, which<br>
> > > didn't yet exist in 1978. Regardless, Unix still doesn't expose a<br>
> > > particularly convenient syntax for expressing these sorts of<br>
> > > constructions at the shell.<br>
> ><br>
> > Process substitution is about as close as we can get, but most programs<br>
> > still process their filename arguments one at a time, beginning to end.<br>
> ><br>
> > The canonical process substitution example is<br>
> ><br>
> > diff <(old-program-version) <(new-program-version)<br>
> ><br>
> > to do simple regression testing.<br>
><br>
> And fanout is simply<br>
><br>
> ... | tee >(pipeline1) >(pipeline2)<br>
<br>
And indeed these things are pretty nifty, but don't they generate<br>
trees, and not arbitrary dags? They don't quite capture the full<br>
generality of Morrison-style networks since it doesn't seem like<br>
there's a way to connect process substitution fan-out with fan-in; at<br>
least, not conveniently.<br>
<br>
It is, perhaps, notable that Go allows me to do this sort of thing<br>
with channels and goroutines, but it has `select` built into the<br>
language.<br>
<br>
Funny, despite using Unix almost daily for over 30 years now, I don't<br>
think I've ever felt limited by the power of pipelines. On the<br>
contrary, I've lost count of the times I've felt limited on systems<br>
that do Not support pipes.<br>
<br>
- Dan C.<br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><i>My new email address is <a href="mailto:mrochkind@gmail.com" target="_blank">mrochkind@gmail.com</a></i></div></div></div>