View Issue Details

IDProjectCategoryView StatusLast Update
00012061003.1(2016/18)/Issue7+TC2Shell and Utilitiespublic2019-04-04 15:15
Reporterkre Assigned To 
PrioritynormalSeverityEditorialTypeError
Status ClosedResolutionRejected 
NameRobert Elz
Organization
User Reference
SectionXCU 4 -- echo
Page Number2675-6
Line Number87183, 87186, 87204, 87206
Interp Status---
Final Accepted Text
Summary0001206: The echo that supports -n is Bell Labs Unix echo, not "BSD echo"
DescriptionThe description of echo(1) in XCU Chapter 4, refers to the two common
variants as "The historic System V echo" (line 87183) and "The BSD echo"
(line 87186) (and both other places).

The latter is factually incorrect, the former really is as well. That is,
to the best of my recollection (and verification) BSD did absolutely
nothing to echo, until attempts to make versions which could reconcile
with the "other one" - echo (it appears) originated in 3rd edition Bell
Labs Unix (without the -n flag, or any escape sequences, it was trivially
simple).

The -n option appeared in 7th edition Bell Labs Unix (and 32V).

The first appearance of the version that allows \ sequences appears to
have been from USL's PWB (version 1) (though it allowed just \\ \n \c and
\0nnn .. though the latter formed 1 char from an unlimited number of octal
digits after the \0). System III added \b \f \r \t and \v, and limited
the number of octal digits after \0 to 3.

Since PWB came between 6th and 7th edition unix, it is impossible (for
me anyway) to determine which modification happened first (\c or -n).

The current text in the standard makes it appear that the original is the
one with the escapes the "historic" version (line 87183), and that, by
implication, BSD changed it to make the "BSD version". That should be
corrected.
Desired ActionChange line 87183-4 to say

      The version of echo, originating from the USL PWB version of UNIX
      and distributed widely as part of System V, and the requirements on
      XSI implementations in this volume of POSIX.1-2008, are equivalent to:

Change line 87186 to say

      The version of echo from Bell Labs UNIX, as enhanced in the 7th
      edition, and included with BSD distributions is equivalent to:

If desired, one could add a 3rd variant:

      The original historic version of echo from original Bell Labs UNIX,
      from the 3rd to 6th editions, is equivalent to:

      printf "%s\n" "$*"

(If there is any issue with using the TM "UNIX", amend as needed.)

With those changes (not necessarily the reference to old Bell Labs versions)
it should be OK to leave lines 87204 and 87206 unchanged.
TagsNo tags attached.

Relationships

related to 0001222 Closed "echo" specification doesn't reflect current implementations (missing -e, -E and - handling) 

Activities

joerg

2018-09-04 13:59

reporter   bugnote:0004101

You are partially right. -n indeed first appeared in UNIX V7, but it
has been removed with SVSV while introducing the backslash escapes.

BSD on the other side took the UNIX V7 source and kept it for a long time.

This may be the reason, why AT&T calls -n a "BSD feature".

Don Cragun

2019-04-04 15:15

manager   bugnote:0004352

Last edited: 2019-04-04 16:53

This was discussed during the 2019-04-01 and 2019-04-04 conference calls...
Although factually correct at this point, the discussions at the time the standard was being written were based on the then current UNIX System V echo and the BSD4.x echo. The rationale is consistent with those two versions of echo (no matter what either of them used as a basis for the way their code behaved). Trying to change the historical references at this point would do injustice to the discussions that were held at the time the standard was created.

Issue History

Date Modified Username Field Change
2018-09-04 12:02 kre New Issue
2018-09-04 12:02 kre Name => Robert Elz
2018-09-04 12:02 kre Section => XCU 4 -- echo
2018-09-04 12:02 kre Page Number => 2675-6
2018-09-04 12:02 kre Line Number => 87183, 87186, 87204, 87206
2018-09-04 13:59 joerg Note Added: 0004101
2019-04-01 16:33 nick Relationship added related to 0001222
2019-04-04 15:15 Don Cragun Note Added: 0004352
2019-04-04 15:15 Don Cragun Interp Status => ---
2019-04-04 15:15 Don Cragun Status New => Closed
2019-04-04 15:15 Don Cragun Resolution Open => Rejected
2019-04-04 16:53 Don Cragun Note Edited: 0004352