Austin Group Defect Tracker

Aardvark Mark IV

Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001826 [Issue 8 drafts] Shell and Utilities Comment Enhancement Request 2024-04-07 01:48 2024-05-20 15:29
Reporter lanodan View Status public  
Assigned To
Priority normal Resolution Rejected  
Status Closed   Product Version Draft 4.1
Name Haelwenn Monnier
User Reference
Section du
Page Number 2808
Line Number 93064-93067
Final Accepted Text
Summary 0001826: du: space used between <size> and <pathname>, while common implementations use tab
Description Ones where a tab is used as separator, version and permalinks as observance point:
- BSD 4.1 (literal) [^]
- NetBSD [^]
- OpenBSD [^]
- FreeBSD [^]
- MacOS [^]
- GNU coreutils 9.4, even with POSIXLY_CORRECT=1 and POSIX_ME_HARDER=1
- BusyBox 1.36.1
- ToyBox [^]

illumos being the only one I could find where when compiled for /usr/xpg4/bin/du rather than /usr/bin/du, a space is used: [^]

A hunch I have is the literal tab degrading into a space on POSIX side of things.
Desired Action Given how widespread tab separation is: Either changing the specified format of du(1), line 93067 on Draft 4.1, from "%d %s\n" to "%d\t%s\n" or clarifying that either space or tab can be used as separator.
Tags No tags attached.
Attached Files

- Relationships

-  Notes
philip-guenther (reporter)
2024-04-07 02:07

The standard doesn't specify a space between <size> and <pathname>. It says:
    The output from du shall consist of the amount of space allocated to a file and the name of the
    file, in the following format:
    "%d %s\n", <size>, <pathname>

But the STDOUT section is _defined_ by XCU 1.4 where it says:
    The STDOUT section completely describes the standard output of the utility. This
    section is frequently merely a reference to the following section, OUTPUT FILES,
    because many utilities treat standard output and output files in the same manner.
    Record formats are described in a notation similar to that used by the C-language
    function, printf(). See XBD Chapter 5 (on page 121) for a description of this notation.

and when you follow that last reference you find:
    The following characters have the following special meaning in the format string:
    ’ ’ (An empty character position.) Represents one or more <blank> characters.
    ∆ Represents exactly one <space> character.

So the du specification specifies one or more <blank> (space and tab) characters between the <size> and <pathname>

- Issue History
Date Modified Username Field Change
2024-04-07 01:48 lanodan New Issue
2024-04-07 01:48 lanodan Name => Haelwenn Monnier
2024-04-07 01:48 lanodan Section => du
2024-04-07 01:48 lanodan Page Number => 2808
2024-04-07 01:48 lanodan Line Number => 93064-93067
2024-04-07 02:07 philip-guenther Note Added: 0006742
2024-05-20 15:29 Don Cragun Status New => Closed
2024-05-20 15:29 Don Cragun Resolution Open => Rejected

Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker