[TUHS] Unix taste

Doug McIlroy doug at cs.dartmouth.edu
Fri Aug 8 12:12:55 AEST 2014


Thanks, Norman, for reminding me of the actual pipe syntax in v3.
This reinforces the title of one history item on Dennis's
website: "Why Ken had to invent |".

I'd suppressed all memory of the fact that in the pipeline
        ... > cmd > ...
cmd had to be a single token. That was certainly not the intent
of my original proposal. It is understandable, though, as a
minimal hack to the existing shell syntax and its parser, which
accepted occurrences of <token and >token anywhere in a command.

The single-token rule meant that, if you wanted to supply an
option to wc in the pipeline
        ls > wc >
you couldn't write
        ls > wc -l >
as one would expect, but instead had to write
        ls > "wc -l" >
Yet a quoted "wc -l" as a bare command or (I suspect) as the
first command in a pipeline would lead to "command not found".
What a mess!

Soon after, Ken was inspired to invent the | operator, lest
he should have to describe an ugly duckling in public at an
upcoming symposium in London.

Is it possible that the ugliness of the token hack was the
precipitating factor that gave us the sublime | ?  But for
the hack, perhaps we'd still be writing
        ls > wc >

Doug



More information about the TUHS mailing list