Date: Sun, 22 Mar 2009 22:01:46 +0000 From: =?UTF-8?B?TWlrb2zDocWhIEphbm90YQ==?= <mikolas.janota@gmail.com> To: =?UTF-8?B?TWlrb2zDocWhIEphbm90YQ==?= <mikolas.janota@gmail.com>, freebsd-standards@freebsd.org Subject: Re: POSIX conformance of ls -l -1 Message-ID: <682003a60903221501i31d93f58r845c9e3f18ab9695@mail.gmail.com> In-Reply-To: <20090322163200.GA74989@zim.MIT.EDU> References: <682003a60903220754g6c653582lb346f8e8d6bf63cf@mail.gmail.com> <20090322163200.GA74989@zim.MIT.EDU>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Mar 22, 2009 at 4:32 PM, David Schultz <das@freebsd.org> wrote: > On Sun, Mar 22, 2009, Mikol=C3=A1=C5=A1 Janota wrote: >> For the command ls, the POSIX standard, says that "When -l (ell) is >> specified, -1 (one) shall be assumed." >> (http://www.opengroup.org/onlinepubs/000095399/utilities/ls.html) >> >> In the FreeBSD implementation, however, -1 and -l override one >> another. I can't see how this could be POSIX compliant. >> >> I'm on Mac OS X which I believe is using FreeBSD port and the man page >> claims POSIX compliance. Where can I find more information about this? > > Perhaps it's a bug. Comments in the source seem to indicate that > it was done this way on purpose, though. If you have `ls' aliased > to `ls -laG', for example, you can still use `ls -1' on the command > line to force the single-line output (as if the options were `ls -aG'.) > I'm not sure what we ought to do about it. > I think the problem is that -1 is interpreted sometimes as "single-column" and sometimes as "one-per-line". The gnu implementation of ls follows the POSIX standard and ls -l -1 is the same as ls -l, but if you write --format=3Dlong --format=3Dsingle-column, long is overriden. Even though --format=3Dsingle-column and -1 should be the same. --=20 Mikol=C3=A1=C5=A1
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?682003a60903221501i31d93f58r845c9e3f18ab9695>