Norbert P. Copones wrote:
> i tried using both openbsd sort and gnu sort (via coreutils from gnu.org)
>
> both openbsd sort and gnu sort spits out the same output (i think almost
> all linux distro is using gnu sort - though not sure on this)
>
> $ sort sample
>    bread
>   ham
>  bacon
> eggs
>
> $ sort -bk 1 sample (i use gsort -b sample on gnu sort)
>  bacon
>    bread
> eggs
>   ham
>
> in my test, the results are correct.
>
> $ sort sample2                                                                
>  
> Bread
> Eggs
> bacon
> ham
>
> $ sort -f sample2
> bacon
> Bread
> Eggs
> ham
>   
> don't really know. both bsd and gnu version of sort works fine in my test.
>   
Julius Suarez (GMail) wrote:
> Can you try doing something like -
> $ LC_ALL=C   sort   sample
>
> - and see if there would be any changes
> - I remembered having problems with sort, and putting LC_ALL=C helped.
>   


I use PCLinuxOS 2007, which also uses gnu coreutils. As Norbert implied, 
it might be something regarding the distro's configuration that results 
to what I'm getting. This is further validated with Robert's results 
where he uses a Mac.

$ sort --version
sort (GNU coreutils) 5.97
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.


However, I have read about LC_ALL in the manpage of sort. Tried it 
before but that didn't work, Julius. It spits out the same cheese I posted.

$ LC_ALL=C
$ sort sample
 bacon
   bread
eggs
  ham
$ sort sample2
bacon
Bread
Eggs
ham

Part II :-)

Yup, sorry about that. It's "LEADING" whitespaces :-) My bad... Thanks 
Jun. I did a booboo above, I should have exported the variable first.. 
It's cool now. Thanks to everyone...

$ LC_ALL=C
$ export LC_ALL
$ sort sample
   bread
  ham
 bacon
eggs
$ sort sample2
Bread
Eggs
bacon
ham

_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to