[TUHS] ed(1) and Pipes.

Norman Wilson norman at oclsc.org
Thu Nov 16 08:16:47 AEST 2017


Ralph Corderoy:

  ed(1) pre-dates pipes.  When pipes came along, stderr was needed, and
  lots of new idioms were found to make use of them.  Why didn't ed gain a
  `filter' command to accompany `r !foo' and `w !bar'?

===

I sometimes wonder that too.

When I use `ed,' it is usually really qed, an extended ed
written by the late-1970s UNIX crowd here at U of T.  (Rob
Pike, Tom Duff, David Tilbrook, and Hugh Redelmeier, I think.)

qed is something of a kitchen sink, full of clumsy programmability
features that I never use.  The things that keep me using it are:

-- Multiple buffers, each possibly associated with a different
file or just anonymous
-- The ability to copy or move text (the traditional t and m
commands) between buffers as well as within one
-- The ability to send part or all of a buffer to a shell command,
to read data in from a shell command, or to send data out and
replace it with that from the shell command:

>mail user ...
<ps -ef
|tr a-z A-Z

I use the last quite often; it makes qed sort of a workbench for
manipulating and mining text.  One can do the same with the shell
and temporary files, but using an editor buffer is much handier.

sam has similar abilities (but without all the needless programmability).
Were sam less clumsy to use in its non-graphical mode, I'd probably
have abandoned qed for sam.

Norman Wilson
Toronto ON (for real now)


More information about the TUHS mailing list