Dumb "ed" question

wmartin at Almsa-1.ARPA wmartin at Almsa-1.ARPA
Fri Apr 6 00:13:14 AEST 1984


From:      Will Martin -- DRXAL-RI <wmartin at 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



More information about the Comp.unix mailing list