[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sort command - on RED HAT LINUX 6.2
From: |
Kevin . Knowlden |
Subject: |
sort command - on RED HAT LINUX 6.2 |
Date: |
Wed, 20 Jun 2001 16:51:12 +1000 |
Hi There,
I'm not sure if this is a BUG or not but if I use the sort command 'sort
sortbefore -o sortafter' on the file below. It seems to by default ignore
the leading spaces and ends up using the first non space character, accrding
to the manual it should remain unsorted.
A pair of lines is compared as follows: if any key fields have been
specified, sort compares each pair of fields, in the order specified on the
command line, according to the associated ordering options, until a
difference is found or no fields are left. Unless otherwise specified, all
comparisons use the character collating sequence specified by the LC_COLLATE
locale.
sortbefore:
0 00000001 NNNNNN000001000001
76 00000002 NNNNNN000001000001
152 00000003 NNNNNN000001000001
228 00000004 NNNNNN000001000001
304 00000005 NNNNNN000001000001
380 00000006 NNNNNN000001000001
456 00000007 NNNNNN000001000001
532 00000008 NNNNNN000001000001
608 00000009 NNNNNN000001000001
684 00000010 NNNNNN000001000001
760 00000011 NNNNNN000001000001
836 00000012 NNNNNN000001000001
912 00000013 NNNNNN000001000001
988 00000014 NNNNNN000001000001
1064 00000015 NNNNNN000001000001
sortafter:
0 00000001 NNNNNN000001000001
1064 00000015 NNNNNN000001000001
152 00000003 NNNNNN000001000001
228 00000004 NNNNNN000001000001
304 00000005 NNNNNN000001000001
380 00000006 NNNNNN000001000001
456 00000007 NNNNNN000001000001
532 00000008 NNNNNN000001000001
608 00000009 NNNNNN000001000001
684 00000010 NNNNNN000001000001
760 00000011 NNNNNN000001000001
76 00000002 NNNNNN000001000001
836 00000012 NNNNNN000001000001
912 00000013 NNNNNN000001000001
988 00000014 NNNNNN000001000001
I would have expect the sortbefore & sortafter files to be the same, as is
the case on other flavours of UNIX (DEC & SUN). Using sort -n gives me the
expected results for this file but other files may not necessarily contain
numeric values and be a mixture of numeric and non-numeric values.
Is it something to do with the LC_COLLATE setting?
Thanking you in advance.
Kevin Knowlden
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the HPA Postmaster: address@hidden
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
Before opening or using any attachments we recommend you check them
for viruses and defects.
Our liability is limited to resupplying any affected attachments.
www.hpa.com.au
**********************************************************************
- sort command - on RED HAT LINUX 6.2,
Kevin . Knowlden <=