6

I read recently, that the concept of a pipe did not come about before UNIX version 3.

But since UNIX was always about simple programs, that do one thing, composed to do more complex things: How did they manage that, without pipes in the first place?

Minix
  • 5,855
  • Shared memory is my first guess. –  Jul 05 '17 at 17:41
  • 2
    The concept of a pipe, as invented by Doug McIlroy, pre-dates all versions of Unix by at least half a decade. You are talking about the shell syntax and system call. – JdeBP Jul 05 '17 at 17:56
  • It's not quite clear that McIlroy invented the concept. Ritchie mentions that a pipeline is a specific form of coroutine (with the implication that that concept existed "in the ether"). He also mentions that an implementation existed in the "communication files" of the Dartmouth Time Sharing system. But there is no question that McIlroy was the force that pushed pipes into Unix. See Ritchie's article on the evolution of Unix. – NickD Jul 05 '17 at 19:40
  • JdeBP is right — before the invention of the pipe, people communicated with smoke signals and carrier pigeons. Pipes have been around for a *long* time. – Scott - Слава Україні Jul 05 '17 at 19:45
  • @Scott Abraham Lincoln had a pipe. Computers didn't start using carrier pigeons until 1990: https://tools.ietf.org/html/rfc1149 – Barmar Jul 05 '17 at 20:24
  • The question is: were they using their pipes to send smoke signals? – NickD Jul 05 '17 at 21:08

1 Answers1

9

IO redirection was not present in the initial PDP-7 implementation (circa 1969) but was added very shortly thereafter. With that, you can implement the moral equivalent of a pipe:

prog1 | prog2

could be implemented with

prog1 > tempfile
prog2 < tempfile
rm tempfile

In fact, pipes are often explained using this model.

The paper The Evolution of the Unix Time-sharing System by Ritchie is highly recommended for early Unix history.  It states, "Pipes appeared in Unix in 1972".

NickD
  • 2,926