sort

David Gregg <[email protected]>
Newsgroups gmane.comp.gnu.textutils.bugs
Message-ID <[email protected]>
Hi There,

I'm using:
sort (textutils) 2.0.21
Written by Mike Haertel and Paul Eggert.

I have a file called "bob" consisting of the lines:
@_0<_0=_and_;s / super3772 = @ 0< 0= and ;s
0<_0=_and_;s / super7840 = 0< 0= and ;s
0<_0=_and / super14257 = 0< 0= and
@_0<_0=_and / super6513 = @ 0< 0= and

If I type "sort bob" then I get the following output:
@_0<_0=_and_;s / super3772 = @ 0< 0= and ;s
0<_0=_and_;s / super7840 = 0< 0= and ;s
0<_0=_and / super14257 = 0< 0= and
@_0<_0=_and / super6513 = @ 0< 0= and

In other words, sort thinks that this is a correct sorting of the file.
It is not. The correct output should be:
0<_0=_and / super14257 = 0< 0= and
0<_0=_and_;s / super7840 = 0< 0= and ;s
@_0<_0=_and / super6513 = @ 0< 0= and
@_0<_0=_and_;s / super3772 = @ 0< 0= and ;s

If I had typed "sort -d bob" (-d specifies to ignore all characters except
alphanumeric ones) then this would be the correct output.

I tried this out on another machine which has "sort (GNU textutils) 1.22"
and it behaves correctly. The sort program on our Digital Unix box also
works correctly.

The awkward thing about this bug is that while it is possible to turn on
the -d option on other versions of the sort program if you want this
behaviour, on "sort (textutils) 2.0.21" there is no way to turn off this
behaviour.

Thanks,

David.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.