Hello,

I can't believe it, but the sort command appears to have a sorting bug!

I'm running version 2.0.14 on RedHat 7.3.

If I put these 3 lines in a file 'foo'...

packages/YCC Form.pm
packages/YCC/Form HistoryForm.pm
packages/YCC/Form PropertyForm.pm

and then type 'sort foo', I get...

packages/YCC/Form HistoryForm.pm
packages/YCC Form.pm
packages/YCC/Form PropertyForm.pm

How can this be under any circumstances? No matter how you sort it, the
middle line should come out at the end or the beginning! Just to make
sure I wasn't crazy, I wrote a perl program to make sure I wasn't just
missing a funny character or something...

my @list;
my $ln;
while ($ln = <>) {
    push(@list, $ln);
}
print join('', sort @list);

The Perl program on the exact file I'm using for this test is...

packages/YCC Form.pm
packages/YCC/Form HistoryForm.pm
packages/YCC/Form PropertyForm.pm

... which is what I would expect. I'm cutting and pasting all this, so
this is the exact input and output.

I'd love to hear a logical explanation for this! :)

Thanks,

Tim Behrendsen


_______________________________________________
Bug-textutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-textutils

Reply via email to