Locale settings and awk

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Locale settings and awk
# 1  
Old 06-03-2009
Locale settings and awk

Hi,

We are trying a few things on our new RHEL machine and I noticed some strange behaviours happening in awk.
We are using the swedish locale sv_SE.iso88591, where you have three additional letters in the alphabet: ... X Z Å Ä Ö (in that order).

I can sort text files following the above natural order no problem.

Code:
[cscyabl@basstest03 ~]$ cat test
Å
Ö
Z
Ä
X
[cscyabl@basstest03 ~]$ sort test
X
Z
Å
Ä
Ö

But awk is giving me some serious trouble:

Code:
[cscyabl@basstest03 ip]$ echo | awk '{if ("Ä" < "Å") print "error"}'
error
[cscyabl@basstest03 ip]$

It seems to react like LC_ALL was set to C which it isn't...
Any suggestion for making the comparison follow the natural order required by the contents of my locales? I have also tried using gawk but it didn't make any difference...

Cheers
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Locale changes?

I am upgrading a machine to Solaris 10 and noticed a change that would cause a problem for us. We have always used en_US.ISO8859-1 and selected that when setting up the new system. This is the format on our old system $ date Fri Sep 21 10:35:51 PDT 2012 And this is what I got on our old... (1 Reply)
Discussion started by: Bryan.Eidson
1 Replies

2. UNIX for Dummies Questions & Answers

Need help with Timezone locale.

HI Gurus, I have a issue. One of our applications needs the data loads with the timezone (CST) but our zones run on GMT. I tried to change the TZ value under /etc/default/init value but it seems to effect the the whole zone. Is there any way I can just set up the TZ as CST for a particular user.... (2 Replies)
Discussion started by: rama krishna
2 Replies

3. Solaris

Locale woes

Greetings Forumers! I've been fighting a locale problem on a v490 running Solaris 10 u4 (8/07). When I login to the system, I get several "locale" error messages: user1's password: Last login: Wed May 26 2010 09:14:13 -0400 from system1 You have mail. couldn't set locale correctly couldn't... (0 Replies)
Discussion started by: bluescreen
0 Replies

4. Shell Programming and Scripting

sftp without locale

Hi all, today i encounter one weird problem. I tried to do the sftp of one file from one server to another and try to load that file in some datawarehouse with a informatica(extraction,tranformation and loading tool) . But the tool is rejecting all later i found that there is some problem in... (0 Replies)
Discussion started by: narang.mohit
0 Replies

5. Solaris

Locale installation..

Hi All, I need to install a swedish locale on a solaris machine(ver. 10).I have the package downloaded.Can anyone please guide me through the steps and things i need to keep in mind when doing the same? (7 Replies)
Discussion started by: sankasu
7 Replies

6. Solaris

Installation of locale..

Hi All, i am pretty new to sun solaris env.I need to install a french locale onto my machine.Could you please guide me through the steps. (1 Reply)
Discussion started by: sankasu
1 Replies

7. Solaris

how do I change locale settings?

I support a product which writes to log files and it's currently formatting the date in US format. I've established this is due to these settings: account1# locale -k d_fmt t_fmt d_fmt="%m/%d/%y" t_fmt="%H:%M:%S" If I log on with a different account the settings are different: ... (1 Reply)
Discussion started by: m223464
1 Replies

8. UNIX for Dummies Questions & Answers

Using locale

:confused: Can anyone tell me how to test that locale is working properly in commands like awk, basename, bg, cd, cmp, col, command, csplit, cut, echo, egrep For ex. suppose I have changed locale using LC_ALL=german_germany.8859 export LC_ALL now i want to test(see) it's effect on... (3 Replies)
Discussion started by: alodha
3 Replies

9. UNIX for Dummies Questions & Answers

Input Locale

Hi Guys, Any ideas on how to install the zh_CN (Simplified Chinese) input locale for AIX5.2 ? Can't seem to find it any where. S. (2 Replies)
Discussion started by: stumpy
2 Replies

10. Programming

Locale setting

Hi, In the sample program, I am trying to print a Japanese string. The code is as follows: main() { setlocale(LC_ALL,""); printf("String is %S\n", L"JAP"); // Note "JAP" is a valid japanese string } If locale is C, the string gets printed, but if it a valid japanese locale, it... (1 Reply)
Discussion started by: Dippan
1 Replies
Login or Register to Ask a Question
DateTime::Locale::sv_SE(3pm)				User Contributed Perl Documentation			      DateTime::Locale::sv_SE(3pm)

NAME
DateTime::Locale::sv_SE - DateTime locale package for "sv_SE" SYNOPSIS
use DateTime; my $dt = DateTime->now( locale => 'sv_SE' ); print $dt->month_name(); DESCRIPTION
This is the DateTime locale package for Swedish Sweden. DATA
This locale inherits from the DateTime::Locale::sv locale. It contains the following data. Days Wide (format) maandag tisdag onsdag torsdag fredag loerdag soendag Abbreviated (format) maan tis ons tors fre loer soen Narrow (format) M T O T F L S Wide (stand-alone) maandag tisdag onsdag torsdag fredag loerdag soendag Abbreviated (stand-alone) maan tis ons tors fre loer soen Narrow (stand-alone) M T O T F L S Months Wide (format) januari februari mars april maj juni juli augusti september oktober november december Abbreviated (format) jan feb mar apr maj jun jul aug sep okt nov dec Narrow (format) J F M A M J J A S O N D Wide (stand-alone) januari februari mars april maj juni juli augusti september oktober november december Abbreviated (stand-alone) jan feb mar apr maj jun jul aug sep okt nov dec Narrow (stand-alone) J F M A M J J A S O N D Quarters Wide (format) 1:a kvartalet 2:a kvartalet 3:e kvartalet 4:e kvartalet Abbreviated (format) K1 K2 K3 K4 Narrow (format) 1 2 3 4 Wide (stand-alone) 1:a kvartalet 2:a kvartalet 3:e kvartalet 4:e kvartalet Abbreviated (stand-alone) K1 K2 K3 K4 Narrow (stand-alone) 1 2 3 4 Eras Wide foere Kristus efter Kristus Abbreviated f.Kr. e.Kr. Narrow f.Kr. e.Kr. Date Formats Full 2008-02-05T18:30:30 = tisdag 5 februari 2008 1995-12-22T09:05:02 = fredag 22 december 1995 -0010-09-15T04:44:23 = loerdag 15 september -10 Long 2008-02-05T18:30:30 = 5 februari 2008 1995-12-22T09:05:02 = 22 december 1995 -0010-09-15T04:44:23 = 15 september -10 Medium 2008-02-05T18:30:30 = 5 feb 2008 1995-12-22T09:05:02 = 22 dec 1995 -0010-09-15T04:44:23 = 15 sep -10 Short 2008-02-05T18:30:30 = 2008-02-05 1995-12-22T09:05:02 = 1995-12-22 -0010-09-15T04:44:23 = -010-09-15 Default 2008-02-05T18:30:30 = 5 feb 2008 1995-12-22T09:05:02 = 22 dec 1995 -0010-09-15T04:44:23 = 15 sep -10 Time Formats Full 2008-02-05T18:30:30 = kl. 18.30.30 UTC 1995-12-22T09:05:02 = kl. 09.05.02 UTC -0010-09-15T04:44:23 = kl. 04.44.23 UTC Long 2008-02-05T18:30:30 = 18.30.30 UTC 1995-12-22T09:05:02 = 09.05.02 UTC -0010-09-15T04:44:23 = 04.44.23 UTC Medium 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Short 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 Default 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 Datetime Formats Full 2008-02-05T18:30:30 = tisdag 5 februari 2008 kl. 18.30.30 UTC 1995-12-22T09:05:02 = fredag 22 december 1995 kl. 09.05.02 UTC -0010-09-15T04:44:23 = loerdag 15 september -10 kl. 04.44.23 UTC Long 2008-02-05T18:30:30 = 5 februari 2008 18.30.30 UTC 1995-12-22T09:05:02 = 22 december 1995 09.05.02 UTC -0010-09-15T04:44:23 = 15 september -10 04.44.23 UTC Medium 2008-02-05T18:30:30 = 5 feb 2008 18.30.30 1995-12-22T09:05:02 = 22 dec 1995 09.05.02 -0010-09-15T04:44:23 = 15 sep -10 04.44.23 Short 2008-02-05T18:30:30 = 2008-02-05 18.30 1995-12-22T09:05:02 = 1995-12-22 09.05 -0010-09-15T04:44:23 = -010-09-15 04.44 Default 2008-02-05T18:30:30 = 5 feb 2008 18.30.30 1995-12-22T09:05:02 = 22 dec 1995 09.05.02 -0010-09-15T04:44:23 = 15 sep -10 04.44.23 Available Formats d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 EEEd (d EEE) 2008-02-05T18:30:30 = 5 tis 1995-12-22T09:05:02 = 22 fre -0010-09-15T04:44:23 = 15 loer HHmm (HH.mm) 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 09.05 -0010-09-15T04:44:23 = 04.44 hhmm (hh.mm a) 2008-02-05T18:30:30 = 06.30 em 1995-12-22T09:05:02 = 09.05 fm -0010-09-15T04:44:23 = 04.44 fm HHmmss (HH.mm.ss) 2008-02-05T18:30:30 = 18.30.30 1995-12-22T09:05:02 = 09.05.02 -0010-09-15T04:44:23 = 04.44.23 hhmmss (h.mm.ss a) 2008-02-05T18:30:30 = 6.30.30 em 1995-12-22T09:05:02 = 9.05.02 fm -0010-09-15T04:44:23 = 4.44.23 fm Hm (H.mm) 2008-02-05T18:30:30 = 18.30 1995-12-22T09:05:02 = 9.05 -0010-09-15T04:44:23 = 4.44 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 em 1995-12-22T09:05:02 = 9:05 fm -0010-09-15T04:44:23 = 4:44 fm Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 em 1995-12-22T09:05:02 = 9:05:02 fm -0010-09-15T04:44:23 = 4:44:23 fm M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 Md (d/M) 2008-02-05T18:30:30 = 5/2 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/9 MEd (E d/M) 2008-02-05T18:30:30 = tis 5/2 1995-12-22T09:05:02 = fre 22/12 -0010-09-15T04:44:23 = loer 15/9 MMd (d/M) 2008-02-05T18:30:30 = 5/2 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/9 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 MMM (LLL) 2008-02-05T18:30:30 = feb 1995-12-22T09:05:02 = dec -0010-09-15T04:44:23 = sep MMMd (d MMM) 2008-02-05T18:30:30 = 5 feb 1995-12-22T09:05:02 = 22 dec -0010-09-15T04:44:23 = 15 sep MMMEd (E d MMM) 2008-02-05T18:30:30 = tis 5 feb 1995-12-22T09:05:02 = fre 22 dec -0010-09-15T04:44:23 = loer 15 sep MMMMd (d MMMM) 2008-02-05T18:30:30 = 5 februari 1995-12-22T09:05:02 = 22 december -0010-09-15T04:44:23 = 15 september MMMMEd (E d MMMM) 2008-02-05T18:30:30 = tis 5 februari 1995-12-22T09:05:02 = fre 22 december -0010-09-15T04:44:23 = loer 15 september MMMMEEEd (EEE d MMMM) 2008-02-05T18:30:30 = tis 5 februari 1995-12-22T09:05:02 = fre 22 december -0010-09-15T04:44:23 = loer 15 september ms (mm.ss) 2008-02-05T18:30:30 = 30.30 1995-12-22T09:05:02 = 05.02 -0010-09-15T04:44:23 = 44.23 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 yM (yyyy-MM) 2008-02-05T18:30:30 = 2008-02 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -010-09 yMEd (EEE, yyyy-MM-dd) 2008-02-05T18:30:30 = tis, 2008-02-05 1995-12-22T09:05:02 = fre, 1995-12-22 -0010-09-15T04:44:23 = loer, -010-09-15 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 feb 1995-12-22T09:05:02 = 1995 dec -0010-09-15T04:44:23 = -10 sep yMMMEd (EEE d MMM y) 2008-02-05T18:30:30 = tis 5 feb 2008 1995-12-22T09:05:02 = fre 22 dec 1995 -0010-09-15T04:44:23 = loer 15 sep -10 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 februari 1995-12-22T09:05:02 = 1995 december -0010-09-15T04:44:23 = -10 september yQ (yyyy Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -010 3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 K1 1995-12-22T09:05:02 = 1995 K4 -0010-09-15T04:44:23 = -10 K3 yyMM (yy-MM) 2008-02-05T18:30:30 = 08-02 1995-12-22T09:05:02 = 95-12 -0010-09-15T04:44:23 = -10-09 yyMMM (MMM -yy) 2008-02-05T18:30:30 = feb -08 1995-12-22T09:05:02 = dec -95 -0010-09-15T04:44:23 = sep --10 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 yyyyMM (yyyy-MM) 2008-02-05T18:30:30 = 2008-02 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -010-09 yyyyMMM (MMM y) 2008-02-05T18:30:30 = feb 2008 1995-12-22T09:05:02 = dec 1995 -0010-09-15T04:44:23 = sep -10 yyyyQQQQ (QQQQ y) 2008-02-05T18:30:30 = 1:a kvartalet 2008 1995-12-22T09:05:02 = 4:e kvartalet 1995 -0010-09-15T04:44:23 = 3:e kvartalet -10 Miscellaneous Prefers 24 hour time? Yes Local first day of the week maandag SUPPORT
See DateTime::Locale. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT
Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. perl v5.10.1 2010-03-19 DateTime::Locale::sv_SE(3pm)