Bob, Whitespace are spaces - checked that out first.
Just so you know - I found a way around the problem. I made the primary part of the sort (first field) the same length - and the sort works correctly. I suspect somewhere in the code, the first whitespace found sets the length for all elements in the sort - - or - the buffer being used is not reset before filling it with non-whitespace characters for sorting. - I'm running under the BASH shell. Results for you on my environment - log>sort --version sort (coreutils) 4.5.3 Written by Mike Haertel and Paul Eggert. Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [EMAIL PROTECTED]:/app/home/tnsapps/TNSListener/log log>uname -a Linux nyl06a-7504 2.4.21-32.0.1.ELsmp #1 SMP Tue May 17 17:52:23 EDT 2005 i686 i 686 i386 GNU/Linux [EMAIL PROTECTED]:/app/home/tnsapps/TNSListener/log log>locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= [EMAIL PROTECTED]:/app/home/tnsapps/TNSListener/log - Remember, I had set the LC_ALL=C and it did not change the sort sequence. If there is a problem in the code, it should be fixed - but not to please me. As I said, I found a way around it. Thanks, Dick -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 22, 2006 1:37 AM To: Oshea, Richard Cc: '[email protected]' Subject: Re: Using SORT on Linux Oshea, Richard wrote: > Not sure if this is a bug or a problem with the way my environment > it setup - or the way I'm using sort - But... Given the following > data in a file, the sort command does not produce the correct > output. Are you passing any options to sort? > I have even tried setting the LC_ALL as suggested in the sort --help > (set LC_ALL=C) "set LC_ALL=C"? What shell are you using? Try this: env LC_ALL=C sort > AG 1 > AG2 3 > AG2 2 > AG3 4 > AG 4 > AG3 3 > AG4 5 > AG4 6 > > The results are > > AG 1 > AG2 2 > AG2 3 > AG3 3 > AG3 4 > AG 4 > AG4 5 > AG4 6 Check the whitespace characters. Are there non-printable characters there? > I would expect the output to be more like ... > > AG 1 > AG 4 > AG2 2 > AG2 3 > AG3 3 > AG3 4 > AG4 5 > AG4 6 That is the result I get on my machine when I test with your input. What version of sort are you using? What operating system are you working on? What locale are you using? sort --version uname -a locale Bob ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ============================================================================== _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
