Subject: Re: bug#15828: behavior of ls -f

From: Pádraig Brady <[email-masked]>
Date: Thu, 07 Nov 2013 19:57:28 +0000

tag 15828 notabug
close 15828
stop

On 11/07/2013 06:54 PM, Aharon Robbins wrote:
> Hello.
> 
> There is a difference between the Solaris ls and ls on GNU/Linux
> and many other systems. In particular, ls -f turns off -l (and other
> options, see below).
> 
> This breaks a test I have in the gawk test suite.
> 
> The citation from POSIX:
> 
>>> The readdir test fails because the -f option to ls turns off -l. I think
>>> the Solaris ls is broken.
>>
>> This is perfectly POSIX-compliant behavior. See
>>   http://pubs.opengroup.org/onlinepubs/000095399/utilities/ls.html
>>
>> -f [XSI]  Force each argument to be interpreted as a directory and list the
>>    name found in each slot. This option shall turn off -l, -t, -s, and -r, and
>>    shall turn on -a; the order is the order in which entries appear in the directory. 
> 

The newest POSIX says "may turn off" -l:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ls.html

> And even if I set POSIXLY_CORRECT GNU/Linux ls doesn't turn off -l.
> 
> 	$ ls --version
> 	ls (GNU coreutils) 8.13
> 
> I will probably rewrite my test (sigh).
> 
> In the meantime, comments?

FreeBSD and GNU ls are in sync and don't turn off -l with -f
solaris is compliant but divergent here.

I don't see a need for -f to ignore any -l,
hence I'm closing this issue for now.

thanks,
Pádraig.