FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 07-18-2008, 11:49 PM
"Mark David Dumlao"
 
Default Non-case sensitive alphabetical sorting

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]?
 
Old 07-19-2008, 07:02 AM
Neil Bothwick
 
Default Non-case sensitive alphabetical sorting

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.
 
Old 07-19-2008, 07:05 AM
Sebastian Günther
 
Default Non-case sensitive alphabetical sorting

* 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
 
Old 07-21-2008, 01:12 PM
Steven Lembark
 
Default Non-case sensitive alphabetical sorting

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
 
Old 07-22-2008, 03:16 AM
"Mark David Dumlao"
 
Default Non-case sensitive alphabetical sorting

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.
 
Old 07-22-2008, 03:50 AM
Albert Hopkins
 
Default Non-case sensitive alphabetical sorting

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/
 
Old 07-22-2008, 04:26 AM
"Mark David Dumlao"
 
Default Non-case sensitive alphabetical sorting

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.
 
Old 07-22-2008, 04:52 AM
Albert Hopkins
 
Default Non-case sensitive alphabetical sorting

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
 
Old 07-22-2008, 04:54 AM
Nikos Chantziaras
 
Default Non-case sensitive alphabetical sorting

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).
 

Thread Tools




All times are GMT. The time now is 04:30 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org