Am 23.11.2014 23:08, schrieb Daniel Dickman: > On Sun, Nov 23, 2014 at 4:43 PM, Jason McIntyre <[email protected]> wrote: >> On Sun, Nov 23, 2014 at 10:46:23AM +0100, Ezequiel Garz?n wrote: >>> Hello, everyone. I've noticed that in OpenBSD ed(1) doesn't mark the >>> end of each line with a '$' when the list command 'l' is invoked. Is >>> this a deliberate deviation from the POSIX standard? Is there any >>> rationale for it? It looks like this should help "print the addressed >>> lines unambiguously" when dealing with trailing spaces, no? >>> >>> Thanks and cheers, >>> >>> Ezequiel >>> >> >> i don't know, but i'd like to. >> >> there is nothing in bin/ed/POSIX concerning `l', but commit history to >> that file is not exactly inspiring. >> >> there is nothing in the posix page for ed documenting whether this is >> something recent. it's there in 2008, and in the 2013 update. >> >> it would be good to know how other bsds behave, and whether the >> behaviour is considered desireable. then we'd know if behaviour should >> be changed, or whether a doc update is enough. >> >> if i don;t get any concrete feedback on that, i'll update the doc. >> >> anyone want to chip in? >> >> jmc >> > > Hi Jason, commenting out CFLAGS+=-DBACKWARDS and recompiling will show > the $ at the end of long lines. > > bin/ed/README says: > BACKWARDS - for backwards compatibility > > This hasn't changed since 1995. Anyone know what ed is supposed to be > backwards compatible with? >
Hello, probably "backwards" with regard to the pre-posix aera. Apparently there was no exact or a different specification for the "l" command of ed before IEEE P1003.2 Draft 11.1. (that document was closed on July 19, 1991) Looking at IEEE P1003.2 Draft 11.2 [1] you will notice that paragraph 4.20.7.3.14 "List Command" was added/changed in draft 11.1. Note the "1" at the right end of each line... and the document states -- Quote-- This draft uses small numbers in the right margin in lieu of change bars. 2 ``2'' denotes changes from Draft 11.1 to Draft 11.2. ``1'' denotes 2 changes from Draft 11 to Draft 11.1. All diff-marks prior to Draft 11.1 1 have been removed. Trivial informative (i.e., non-normative) changes and purely editorial changes such as grammar, spelling, or cross references are not diff-marked. -- End Quote -- Does anyone have drafts earlier than 11.1 of IEEE P1003.2 so this could be verified. The manpage of ed from the sixth edition unix (V6 1975) [2] does not mention the $ at the end of a line for the "l" command. The ed reference in appendix 1 of my exemplar of "The Unix Programming Environment" by Kernighan and Pike from 1984 does not mention the $ at the end of a listed line either. Looking at the X/Open CAE Specifications, Commands and Utilities, Issue 4, Version 2 from September 1994 [3], the $ at the end of each line for the ed "l" command is specified at page 290. Unfirtunately I have no access to earlier versions of this document. [1] http://www.nic.funet.fi/pub/doc/posix/p1003.2/d11.2/all [2] http://roguelife.org/~fujita/COOKIES/HISTORY/V6/ed.1.html [3] https://www2.opengroup.org/ogsys/catalog/c436 HTH rru

