View Issue Details

IDProjectCategoryView StatusLast Update
00004231003.1(2008)/Issue 7Shell and Utilitiespublic2013-04-16 13:06
ReporterDon Cragun Assigned Toajosey  
PrioritynormalSeverityObjectionTypeError
Status ClosedResolutionAccepted 
NameDon Cragun
OrganizationSelf
User Referencels -m
Sectionls
Page Number2865,2867
Line Number93790,93858-93860
Interp StatusApproved
Final Accepted TextSee 0000423:0000804
Summary0000423: ls -m output format is not clear
Description
The description of the -m option on P2865, L93790 says:
    Stream output format; list files across the page, separated by
    <comma> characters.

The output format for the -m option on P2867, L93858-93860 says:
    When −m is specified, the format used shall be:

    "%s, %s, ...\n", <filename1>, <filename2>

    where the largest number of filenames shall be written without
    exceeding the length of the line.

There are at least two problems here:
1.  The description says that the separator is <comma>, but the output
    format requires that the separator is a <comma> followed by one or
    more <blank> characters.
2.  The output format implies that a filename that is longer than the
    current line length can't be printed.

One implementation I know of prints an empty line before the list of files
when the first filename in the output is longer than the line length.  This
is clearly a bug.

It also always uses a <comma> and a single <space> as a separator with
a <newline> inserted after the separator if printing the following entry
would exceed the line length.  This seems reasonable.  However, some
implementations skip the trailing <space> at the end of a line.  This fix
allows, but does not require the trailing <space>.
Desired Action
Change the description of the -m option on P2865, L93790 to:
    Stream output format; list pathnames across the page, separated
    by a <comma> character followed by a <space> character.  Use
    a <newline> character as the list terminator and after the
    separator sequence when there isn't room on a line for the next
    list entry.

Change the output format for the -m option on P2867, L93858-93860 to:
    When −m is specified, the format used for the last element of the list
    shall be:

    "%s\n", <filename>

    The format used for each other element of the list shall be:

    "%s,%s", <filename>, <separator>

    where, if there is not room for the next element of the list to fit
    within the current line length, <separator> is a string containing
    an optional <space> character and a mandatory <newline>
    character; otherwise it is a single <space> character.
Tagstc1-2008

Activities

nick

2011-06-09 15:19

manager   bugnote:0000804

Last edited: 2011-06-09 15:20

Interpretation response
------------------------
The standard is unclear on this issue, and no conformance distinction can be made between alternative implementations based on this. This is being referred to the sponsor.

Rationale:
-------------
See Description.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
See "Desired Action"

ajosey

2011-06-16 10:17

manager   bugnote:0000851

Interpretation proposed 16 June 2011 for final 30 day review

ajosey

2011-07-29 06:13

manager   bugnote:0000901

The interpretation is now approved.

Issue History

Date Modified Username Field Change
2011-05-08 15:18 Don Cragun New Issue
2011-05-08 15:18 Don Cragun Status New => Under Review
2011-05-08 15:18 Don Cragun Assigned To => ajosey
2011-05-08 15:18 Don Cragun Name => Don Cragun
2011-05-08 15:18 Don Cragun Organization => Self
2011-05-08 15:18 Don Cragun User Reference => ls -m
2011-05-08 15:18 Don Cragun Section => ls
2011-05-08 15:18 Don Cragun Page Number => 2865,2867
2011-05-08 15:18 Don Cragun Line Number => 93790,93858-93860
2011-05-08 15:18 Don Cragun Interp Status => ---
2011-06-02 16:40 Don Cragun Description Updated
2011-06-02 16:40 Don Cragun Desired Action Updated
2011-06-09 15:19 nick Note Added: 0000804
2011-06-09 15:20 nick Note Edited: 0000804
2011-06-09 15:21 nick Interp Status --- => Pending
2011-06-09 15:21 nick Final Accepted Text => See 0000423:0000804
2011-06-09 15:21 nick Status Under Review => Interpretation Required
2011-06-09 15:21 nick Resolution Open => Accepted
2011-06-09 15:22 nick Tag Attached: tc1-2008
2011-06-16 10:17 ajosey Interp Status Pending => Proposed
2011-06-16 10:17 ajosey Note Added: 0000851
2011-07-29 06:13 ajosey Interp Status Proposed => Approved
2011-07-29 06:13 ajosey Note Added: 0000901
2013-04-16 13:06 ajosey Status Interpretation Required => Closed