[net.unix] Dumb "ed" question

wmartin@Almsa-1.ARPA (04/05/84)

From:      Will Martin -- DRXAL-RI <wmartin@Almsa-1.ARPA>


I've been using various flavors of UNIX over the past few months, and
I've run into an annoying anomaly with the "ed" editor. On some systems,
there is an "n" command in ed, equivalent to "p", but which prints the
line numbers of each requested line on the left margin. On other systems,
"n" is unrecognized by ed. I had started on systems where "n" was available,
and found its lack a great irritation. I've used both varieties enough that
the irritation has faded by now, but this discrepancy confuses me.

I am guessing that the difference is due to the "n" being included in ed
in System III and later UNIX versions and lookalikes, and NOT being
present in v7, earlier versions, and v7 descendents like BSD. Is this
a correct assumption? If not, what is the distinction?

If this is the case, and essentially earlier systems don't have it, can
anyone explain why? It seems totally incomprehensible to me that a
line editor which depends in many ways on the user knowing the line
number would be designed without a command that shows the user these
line numbers. (I know that you can get around it with selecting by
strings, but it's often much simpler to just know and use the numbers.)

Elucidation appreciated...

Will

gwyn@Brl-Vld.ARPA (04/05/84)

From:      Doug Gwyn (VLD/VMB) <gwyn@Brl-Vld.ARPA>

I don't know exactly which version of "ed" first had the "n" command,
but it definitely was not in the earliest "ed"s.  This is only one of
many features lacking in 7th Edition/4.nBSD "ed".

In any "ed" one can get the current line number printed by
	.=
so lack of "n" is not as bad as you make it sound, although it IS a
nuisance if your habits include using it.  I can't stand the old
versions of "ed" and use the UNIX System V version myself.  Some of
the people around here like the (incompatible) JHU version "jed".

steve@Brl-Bmd.ARPA (04/06/84)

From:      Stephen Wolff <steve@Brl-Bmd.ARPA>

Many of us at BRL grew up with the JHU/BRL editor that was hacked - upward
compatibly - from the Version 6 `ed', and we still prefer it to later
versions.  It has the `n' feature, of course, as well as a number of niceties
that render it pleasant to use including, for example, the `default print'
feature and the user-definable `print-window' using `<', `>' and `,'.  There
are lots of times when its simple and by now natural functionality make it
the editor of choice over other line-based editors and all screen editors.
It's /bin/ed on our PDP-11s and /usr/brl/bin/jed on the VAXen.