View Issue Details

IDProjectCategoryView StatusLast Update
00012211003.1(2016/18)/Issue7+TC2Shell and Utilitiespublic2019-02-23 14:05
ReporterDon Cragun Assigned To 
PrioritynormalSeverityObjectionTypeOmission
Status ClosedResolutionWithdrawn 
NameDonald Cragun
Organization
User Reference
Sectionecho
Page Number2674
Line Number87116-87117
Interp Status---
Final Accepted Text
Summary0001221: The DESCRIPTION omits requiring echo to separate arguments with <space>s when writing them.
DescriptionThe current DESCRIPTION section for the echo utility is:
The echo utility writes its arguments to standard output, followed by a <newline>. If there are
no arguments, only the <newline> is written.

That requires that the command:
<tt>echo a b c</tt>

produce the output:
<tt>abc</tt>

All implementations of echo that I have ever used put a single <space> character between arguments when they are written to standard output such that the output produced is:
<tt>a b c</tt>

The only time when <space>s isn't historically added is after <tt>"\c"</tt> has been seen in an argument on XSI-conforming systems (or after a non-conforming option indicates that the XSI <backslash> escapes are to be processed).
Desired ActionChange the first sentence of the DESCRIPTION section to be:
The echo utility writes its arguments, separated by a <space> character, followed by a <newline> character to standard output.
TagsNo tags attached.

Activities

schwarze

2018-12-22 21:21

reporter   bugnote:0004190

To support this proposal, i'd like to mention that this has already been documented in many operating systems for decades. I don't know why POSIX does not mention the blanks. I agree it probably should.

Here are some examples of real-world manuals already documenting the blanks:

https://man.openbsd.org/UNIX-7/echo.1
https://man.openbsd.org/4.4BSD-Lite2/echo.1
https://man.openbsd.org/OpenBSD-current/echo.1
https://man.openbsd.org/FreeBSD-11.1/man1/echo.1
https://man.openbsd.org/NetBSD-7.1/echo.1
https://man.openbsd.org/ksh.1#echo_2
https://man.openbsd.org/csh.1#echo

shware_systems

2018-12-22 22:37

reporter   bugnote:0004191

The DESCRIPTION may omit it, but it is explicitly a normative requirement in the STDOUT section so this would be duplication. It may be better to shorten it to say:
    The echo utility writes its arguments to standard output. [xref See STDOUT]

kre

2018-12-22 23:25

reporter   bugnote:0004192

I see no need for any change, as Mark says in note 4191, the
blank separator is already specified. What's more, I don't see
a need for a forward pointer from the description to the STDOUT
section - for all commands, the STDOUT part of the description
gives any formatting requirements for the output, that always needs
to be consulted.

shware_systems

2018-12-23 16:47

reporter   bugnote:0004193

Normally I wouldn't bother either, but the block of XSI escapes follows, and the Xref would skip people around that who are more interested in the base requirements only.

Issue History

Date Modified Username Field Change
2018-12-22 21:02 Don Cragun New Issue
2018-12-22 21:02 Don Cragun Name => Donald Cragun
2018-12-22 21:02 Don Cragun Section => echo
2018-12-22 21:02 Don Cragun Page Number => 2674
2018-12-22 21:02 Don Cragun Line Number => 87116-87117
2018-12-22 21:02 Don Cragun Interp Status => ---
2018-12-22 21:21 schwarze Note Added: 0004190
2018-12-22 22:37 shware_systems Note Added: 0004191
2018-12-22 23:25 kre Note Added: 0004192
2018-12-23 16:47 shware_systems Note Added: 0004193
2019-02-23 14:05 Don Cragun Status New => Closed
2019-02-23 14:05 Don Cragun Resolution Open => Withdrawn