public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Non-case sensitive alphabetical sorting
@ 2008-07-18 23:49 Mark David Dumlao
  2008-07-19  7:02 ` Neil Bothwick
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mark David Dumlao @ 2008-07-18 23:49 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

When ordering items by name, a separate and distinct sequence is scene for
A-Z before the sequence for a-z. This is the expected behavior. What might i
need to look up to intermix [Aa]-[Zz]?

[-- Attachment #2: Type: text/html, Size: 216 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Non-case sensitive alphabetical sorting
  2008-07-18 23:49 [gentoo-user] Non-case sensitive alphabetical sorting Mark David Dumlao
@ 2008-07-19  7:02 ` Neil Bothwick
  2008-07-19  7:05 ` Sebastian Günther
  2008-07-21 13:12 ` Steven Lembark
  2 siblings, 0 replies; 9+ messages in thread
From: Neil Bothwick @ 2008-07-19  7:02 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 626 bytes --]

On Sat, 19 Jul 2008 07:49:39 +0800, Mark David Dumlao wrote:

> When ordering items by name, a separate and distinct sequence is scene
> for A-Z before the sequence for a-z. This is the expected behavior.
> What might i need to look up to intermix [Aa]-[Zz]?

That depends on what you are using to do the sort. The sort command uses
the -f option for case-insensitive sorting. Bash has an option to handle
this when presenting files that match a pattern, like *, see the man page.

A more detailed question will elicit a more detailed answer.


-- 
Neil Bothwick

Talk is cheap because supply exceeds demand.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Non-case sensitive alphabetical sorting
  2008-07-18 23:49 [gentoo-user] Non-case sensitive alphabetical sorting Mark David Dumlao
  2008-07-19  7:02 ` Neil Bothwick
@ 2008-07-19  7:05 ` Sebastian Günther
  2008-07-21 13:12 ` Steven Lembark
  2 siblings, 0 replies; 9+ messages in thread
From: Sebastian Günther @ 2008-07-19  7:05 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

* Mark David Dumlao (stuffinator@gmail.com) [19.07.08 01:51]:
> When ordering items by name, a separate and distinct sequence is scene for
> A-Z before the sequence for a-z. This is the expected behavior. What might i
> need to look up to intermix [Aa]-[Zz]?

Maybe should state in what application you are trying to sort...

Sebastian

-- 
 " Religion ist das Opium des Volkes. "      Karl Marx

 SEB@STI@N GÜNTHER         mailto:samson@guenther-roetgen.de

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Non-case sensitive alphabetical sorting
  2008-07-18 23:49 [gentoo-user] Non-case sensitive alphabetical sorting Mark David Dumlao
  2008-07-19  7:02 ` Neil Bothwick
  2008-07-19  7:05 ` Sebastian Günther
@ 2008-07-21 13:12 ` Steven Lembark
  2008-07-22  3:16   ` Mark David Dumlao
  2 siblings, 1 reply; 9+ messages in thread
From: Steven Lembark @ 2008-07-21 13:12 UTC (permalink / raw
  To: gentoo-user

Mark David Dumlao wrote:
> When ordering items by name, a separate and distinct sequence is scene 
> for A-Z before the sequence for a-z. This is the expected behavior. What 
> might i need to look up to intermix [Aa]-[Zz]?


Schwartzian Transform is the perlish version of a
technique from LISP: create a compound structure
with the output as payload:

     my @sorted
     = map
     {
         $_->[-1]
     }
     sort
     {
         $a->[0] cmp $b->[0]
     }
     map
     {
         my $sortval = uc $_;

         [ $sortval, $_ ]
     }
     @unsorted_text;

You can use the basic technique to sort anything
(multi-level sorts, numeric, whatever). Same basic
process works in other languages that support anon
arrays or structs.


-- 
Steven Lembark                                            85-09 90th St.
Workhorse Computing                                 Woodhaven, NY, 11421
lembark@wrkhors.com                                      +1 888 359 3508



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Non-case sensitive alphabetical sorting
  2008-07-21 13:12 ` Steven Lembark
@ 2008-07-22  3:16   ` Mark David Dumlao
  2008-07-22  3:50     ` Albert Hopkins
  0 siblings, 1 reply; 9+ messages in thread
From: Mark David Dumlao @ 2008-07-22  3:16 UTC (permalink / raw
  To: gentoo-user

I'm sorry, I wasnt clear in my original post.

When using gnome in ubuntu, clicking the sort by name in nautilus sorts using
[Aa]-[Zz]

When using gnome in gentoo, clicking the sort by name in nautilus yields
A-Z-a-z.

The same thing happens for coreutils ls, and so on.

Is there any file or configuration I have to check to use case
insensitive sorting
in gnome?

On Mon, Jul 21, 2008 at 9:12 PM, Steven Lembark <lembark@wrkhors.com> wrote:
> Mark David Dumlao wrote:
>>
>> When ordering items by name, a separate and distinct sequence is scene for
>> A-Z before the sequence for a-z. This is the expected behavior. What might i
>> need to look up to intermix [Aa]-[Zz]?
>
>
> Schwartzian Transform is the perlish version of a
> technique from LISP: create a compound structure
> with the output as payload:
>
>    my @sorted
>    = map
>    {
>        $_->[-1]
>    }
>    sort
>    {
>        $a->[0] cmp $b->[0]
>    }
>    map
>    {
>        my $sortval = uc $_;
>
>        [ $sortval, $_ ]
>    }
>    @unsorted_text;
>
> You can use the basic technique to sort anything
> (multi-level sorts, numeric, whatever). Same basic
> process works in other languages that support anon
> arrays or structs.
>
>
> --
> Steven Lembark                                            85-09 90th St.
> Workhorse Computing                                 Woodhaven, NY, 11421
> lembark@wrkhors.com                                      +1 888 359 3508
>
>



-- 
thing.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Non-case sensitive alphabetical sorting
  2008-07-22  3:16   ` Mark David Dumlao
@ 2008-07-22  3:50     ` Albert Hopkins
  2008-07-22  4:26       ` Mark David Dumlao
  0 siblings, 1 reply; 9+ messages in thread
From: Albert Hopkins @ 2008-07-22  3:50 UTC (permalink / raw
  To: gentoo-user

On Tue, 2008-07-22 at 11:16 +0800, Mark David Dumlao wrote:
> I'm sorry, I wasnt clear in my original post.
> 
> When using gnome in ubuntu, clicking the sort by name in nautilus
> sorts using
> [Aa]-[Zz]
> 
> When using gnome in gentoo, clicking the sort by name in nautilus
> yields
> A-Z-a-z.
> 
> The same thing happens for coreutils ls, and so on.
> 
Not for me.

> Is there any file or configuration I have to check to use case
> insensitive sorting
> in gnome?

Check your LC_ALL environment variable.

[~]$ LC_ALL=en_US ls
total 56K
4.0K bin/        4.0K exclude    4.0K Private/   4.0K Templates/
4.0K Desktop/    4.0K Media/     4.0K Projects/  4.0K Virtual_Machines/
4.0K Documents/  4.0K Music/     4.0K python/
4.0K Downloads/  4.0K Pictures/  4.0K Python/
                                                                                
[~]$ LC_ALL=C ls
total 56K
4.0K Desktop/    4.0K Music/     4.0K Python/            4.0K exclude
4.0K Documents/  4.0K Pictures/  4.0K Templates/         4.0K python/
4.0K Downloads/  4.0K Private/   4.0K Virtual_Machines/
4.0K Media/      4.0K Projects/  4.0K bin/
                                                                                





^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Non-case sensitive alphabetical sorting
  2008-07-22  3:50     ` Albert Hopkins
@ 2008-07-22  4:26       ` Mark David Dumlao
  2008-07-22  4:52         ` Albert Hopkins
  2008-07-22  4:54         ` [gentoo-user] " Nikos Chantziaras
  0 siblings, 2 replies; 9+ messages in thread
From: Mark David Dumlao @ 2008-07-22  4:26 UTC (permalink / raw
  To: gentoo-user

On Tue, Jul 22, 2008 at 11:50 AM, Albert Hopkins <marduk@letterboxes.org> wrote:
> Check your LC_ALL environment variable.
>
> [~]$ LC_ALL=en_US ls
> total 56K
> 4.0K bin/        4.0K exclude    4.0K Private/   4.0K Templates/
> 4.0K Desktop/    4.0K Media/     4.0K Projects/  4.0K Virtual_Machines/
> 4.0K Documents/  4.0K Music/     4.0K python/
> 4.0K Downloads/  4.0K Pictures/  4.0K Python/
>
> [~]$ LC_ALL=C ls
> total 56K
> 4.0K Desktop/    4.0K Music/     4.0K Python/            4.0K exclude
> 4.0K Documents/  4.0K Pictures/  4.0K Templates/         4.0K python/
> 4.0K Downloads/  4.0K Private/   4.0K Virtual_Machines/
> 4.0K Media/      4.0K Projects/  4.0K bin/

great! what's the correct place to set this globally so that both
terminal and gnome will see it?

-- 
thing.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-user] Non-case sensitive alphabetical sorting
  2008-07-22  4:26       ` Mark David Dumlao
@ 2008-07-22  4:52         ` Albert Hopkins
  2008-07-22  4:54         ` [gentoo-user] " Nikos Chantziaras
  1 sibling, 0 replies; 9+ messages in thread
From: Albert Hopkins @ 2008-07-22  4:52 UTC (permalink / raw
  To: gentoo-user

On Tue, 2008-07-22 at 12:26 +0800, Mark David Dumlao wrote:
[...]
> great! what's the correct place to set this globally so that both
> terminal and gnome will see it?
> 
/etc/env.d





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-user]  Re: Non-case sensitive alphabetical sorting
  2008-07-22  4:26       ` Mark David Dumlao
  2008-07-22  4:52         ` Albert Hopkins
@ 2008-07-22  4:54         ` Nikos Chantziaras
  1 sibling, 0 replies; 9+ messages in thread
From: Nikos Chantziaras @ 2008-07-22  4:54 UTC (permalink / raw
  To: gentoo-user

Mark David Dumlao wrote:
> On Tue, Jul 22, 2008 at 11:50 AM, Albert Hopkins <marduk@letterboxes.org> wrote:
>> Check your LC_ALL environment variable.
>>
>> [~]$ LC_ALL=en_US ls
>> total 56K
>> 4.0K bin/        4.0K exclude    4.0K Private/   4.0K Templates/
>> 4.0K Desktop/    4.0K Media/     4.0K Projects/  4.0K Virtual_Machines/
>> 4.0K Documents/  4.0K Music/     4.0K python/
>> 4.0K Downloads/  4.0K Pictures/  4.0K Python/
>>
>> [~]$ LC_ALL=C ls
>> total 56K
>> 4.0K Desktop/    4.0K Music/     4.0K Python/            4.0K exclude
>> 4.0K Documents/  4.0K Pictures/  4.0K Templates/         4.0K python/
>> 4.0K Downloads/  4.0K Private/   4.0K Virtual_Machines/
>> 4.0K Media/      4.0K Projects/  4.0K bin/
> 
> great! what's the correct place to set this globally so that both
> terminal and gnome will see it?

/etc/env.d/02locale

You need to do 'env-update' as root after any changes there followed by 
'source /etc/profile' (or logging out and in again).




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-07-22  4:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 23:49 [gentoo-user] Non-case sensitive alphabetical sorting Mark David Dumlao
2008-07-19  7:02 ` Neil Bothwick
2008-07-19  7:05 ` Sebastian Günther
2008-07-21 13:12 ` Steven Lembark
2008-07-22  3:16   ` Mark David Dumlao
2008-07-22  3:50     ` Albert Hopkins
2008-07-22  4:26       ` Mark David Dumlao
2008-07-22  4:52         ` Albert Hopkins
2008-07-22  4:54         ` [gentoo-user] " Nikos Chantziaras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox