/bin/ls sorting bug?

Oliver Fromme olli at lurza.secnetix.de
Tue Jun 22 08:19:10 GMT 2004

Greg Black <gjb at gbch.net> wrote:
 > On 2004-06-21, Leo Bicknell wrote:
 > > While I think the particular sort order (current behavior vrs non
 > > nano patch vrs nano patch) is largely unimportant, I think consistency
 > > is very important.  It's quite common to do things like using diff
 > > on the output of commands like ls (indeed, I think several of the
 > > built in periodic scripts to this), and for that having a _reproduceable_
 > > order is important.
 > The output of ls has never been good for reproduceable output
 > for identical data.  It frequently leads to gigantic "diffs" in
 > periodic reports which makes them useless, as far as I can
 > tell.  Take the following case:
 > [...]
 > What we need is a canonical output form for this kind of use
 > that can be fed to a custom diff that can operate on individual
 > fields.

I always use "diff -Bb" for things like that, i.e. to
ignore any changes in whitespace.  Works perfectly fine.

Maybe someone should just add "-b" to the diff command
in those periodic scripts?

Best regards

Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"I started using PostgreSQL around a month ago, and the feeling is
similar to the switch from Linux to FreeBSD in '96 -- 'wow!'."
        -- Oddbjorn Steffensen

More information about the freebsd-hackers mailing list