[TUHS] The ^ = | ?

Norman Wilson norman at nose.cs.utoronto.ca
Fri Jan 24 13:09:51 AEST 2003


The earliest UNIX Programmer's Manual to describe shell
pipelines is the Third Edition, February 1973.  It gives a
syntax quite different from the modern one:

	com1 > com2 > com3 > outfile

meant what we would now write as

	com1 | com2 | com3 > outfile

This original syntax was pretty cumbersome; pretty
obviously it was put in as a quick hack (as were many
things in those early days).  Because > and < applied
only to the following word, pipelined commands with
arguments had to be quoted:

	who > "grep ken" >/tmp/kenlogins

Even worse, the shell had no inherent way to tell whether
the final word was a file or a program; if the last element
in a pipeline was to write to standard output, you had to
say so explicitly:

	who > "grep ken" >

On the other hand the syntax was symmetric: you could
also write

	"grep ken" < who <

pipe(II) also debuted in the Third Edition.

By the Fourth Edition (November 1973) there had evidently
been more time to think about the syntax; the modern notation
is shown, except that ^ is allowed as a synonym for |.  I have
long guessed that was because in those dark days of the
past, some upper-case-only terminals (remember stty lcase?)
offered no way to type | (and perhaps likewise {}`~) but I don't
really know.  Dennis?

Norman Wilson
Toronto ON





More information about the TUHS mailing list