|Anonymous | Login||2018-12-12 12:16 UTC|
|Main | My View | View Issues | Change Log | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Type||Date Submitted||Last Update|
|0001206||[1003.1(2016)/Issue7+TC2] Shell and Utilities||Editorial||Error||2018-09-04 12:02||2018-09-04 13:59|
|Section||XCU 4 -- echo|
|Line Number||87183, 87186, 87204, 87206|
|Final Accepted Text|
|Summary||0001206: The echo that supports -n is Bell Labs Unix echo, not "BSD echo"|
The 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
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
Change 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.
|Tags||No tags attached.|
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".
|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|
|Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group|