coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: du: POSIX mandating a single space instead of tab?


From: Pádraig Brady
Subject: Re: du: POSIX mandating a single space instead of tab?
Date: Tue, 28 Apr 2015 10:59:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

On 28/04/15 08:44, Andreas Schwab wrote:
> Bernhard Voelker
> <address@hidden> writes:
> 
>> Reading POSIX [0] again because of bug#20442 [1], I think that
>> GNU du is violating the spec:
>>
>>     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>
>>
>> Instead, GNU du uses "%d\t%s\n", i.e., a tab character as delimiter,
>> even if POSIXLY_CORRECT is set.
>>
>> Do I read POSIX right?
> 
> No, the space stands for any (positive) amount of white space.
> 
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap05.html#tag_05
> 
> Andreas.
> 

Thanks for pointing that out Andreas.
So a ' ' in a format implies any amount of blank chars.
So we could separate the du columns with spaces rather than tab,
though that would almost definitely introduce a compatibility issue,
and would be inconsistent with Solaris and FreeBSD at least.

cheers,
Pádraig.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]