vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| This has me completely stumped so whoever figures this out gets a cookie. On only *two* of our dozens of Solaris 9 machines, we are seeing very odd behavior from /usr/bin/sort. Depending on the contents of the file, the sort order will be reversed even though the contents should not warrant such a reversing. Here's an example test file: webix web:x webmx Five characters per line, three lines. The colon is a lower ascii number so the sort order should be with the colon first. But this happens: # sort /tmp/foo webix webmx web:x The entry with the colon should be first, not last...? Editing the file to remove the trailing x, which is on every line and shouldn't affect the sort order, somehow does: # vi /tmp/foo (remove trailing x) # cat /tmp/foo webi web: webm # sort /tmp/foo web: webi webm OS revision is: # uname -a SunOS usilcaresap01 5.9 Generic_122300-13 sun4u sparc SUNW,Sun-Fire- V440 What in the heck is going on?? |
| |||
| Jim Leonard <MobyGamer@gmail.com> wrote: > On only *two* of our dozens of Solaris 9 machines, we are seeing very > odd behavior from /usr/bin/sort. Whenever you see sort oddities, think "locale". > What in the heck is going on?? I cannot explain the ':' vs ':x' thing, but it is easily replicated. $ LC_COLLATE=C sort /tmp/foo web: web:x webi webix webm webmx $ LC_COLLATE=en_US.UTF-8 sort /tmp/foo web: webi webix webm webmx web:x -- Darren Dunham ddunham@taos.com Senior Technical Consultant TAOS http://www.taos.com/ Got some Dr Pepper? San Francisco, CA bay area < This line left intentionally blank to confuse you. > |
| |||
| On May 6, 4:23 pm, ddun...@taos.com (Darren Dunham) wrote: > Jim Leonard <MobyGa...@gmail.com> wrote: > > On only *two* of our dozens of Solaris 9 machines, we are seeing very > > odd behavior from /usr/bin/sort. > > Whenever you see sort oddities, think "locale". Sure enough, that's it! Thanks for the help! |
| |||
| On May 7, 9:37 am, Jim Leonard <MobyGa...@gmail.com> wrote: > > > On only *two* of our dozens of Solaris 9 machines, we are seeing very > > > odd behavior from /usr/bin/sort. > > > Whenever you see sort oddities, think "locale". > > Sure enough, that's it! Thanks for the help! On further investigation, it appears as if LOCALE is not getting set up on a few machines, which is confusing since TZ, which is also in / etc/default/init, *is* set up. For example: root# cat /etc/default/init TZ=US/Central CMASK=022 LC_COLLATE=en_US.ISO8859-1 LC_CTYPE=en_US.ISO8859-1 LC_MESSAGES=C LC_MONETARY=en_US.ISO8859-1 LC_NUMERIC=en_US.ISO8859-1 LC_TIME=en_US.ISO8859-1 root# echo $TZ US/Central root# echo $LC_COLLATE root# What could be causing this? Are they never getting set, or are they getting UNset by something? I thought init would set these vars on every process spawn so why are some there and some aren't? |
| |||
| On Wed, 07 May 2008 07:51:17 -0700, Jim Leonard wrote: > root# echo $TZ > US/Central > root# echo $LC_COLLATE > > root# > > > What could be causing this? [duhring@einstein ~]$ locale LANG=C LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_ALL=C |
| |||
| Jim Leonard <MobyGamer@gmail.com> wrote: > On May 7, 9:37 am, Jim Leonard <MobyGa...@gmail.com> wrote: >> > > On only *two* of our dozens of Solaris 9 machines, we are seeing very >> > > odd behavior from /usr/bin/sort. >> >> > Whenever you see sort oddities, think "locale". >> >> Sure enough, that's it! Thanks for the help! > > On further investigation, it appears as if LOCALE is not getting set > up on a few machines, which is confusing since TZ, which is also in / > etc/default/init, *is* set up. For example: > > root# cat /etc/default/init > TZ=US/Central > CMASK=022 > LC_COLLATE=en_US.ISO8859-1 > LC_CTYPE=en_US.ISO8859-1 > LC_MESSAGES=C > LC_MONETARY=en_US.ISO8859-1 > LC_NUMERIC=en_US.ISO8859-1 > LC_TIME=en_US.ISO8859-1 > root# echo $TZ > US/Central > root# echo $LC_COLLATE > > root# > > What could be causing this? Are they never getting set, or are they > getting UNset by something? I thought init would set these vars on > every process spawn so why are some there and some aren't? Are you running in a graphical environment? It's been a while since I've looked at CDE, but Gnome will get a default locale and use it to populate the entire LC_* environment. I believe LANG is what it uses for the default. You can choose a different locale from the login page (under the options dropdown), but it will again use that for _all_ LC_* variables. This is one of a number of horrible locale-related things I've been delving into lately. Ugh. Colin |
| |||
| On May 7, 10:27 am, Dave Uhring <daveuhr...@yahoo.com> wrote: > On Wed, 07 May 2008 07:51:17 -0700, Jim Leonard wrote: > > root# echo $TZ > > US/Central > > root# echo $LC_COLLATE > > > root# > > > What could be causing this? > > [duhring@einstein ~]$ locale > LANG=C > LC_CTYPE="C" > LC_NUMERIC="C" > LC_TIME="C" > LC_COLLATE="C" > LC_MONETARY="C" > LC_MESSAGES="C" > LC_ALL=C Sure enough: root# locale LANG=C LC_CTYPE="C" LC_NUMERIC="C" LC_TIME="C" LC_COLLATE="C" LC_MONETARY="C" LC_MESSAGES="C" LC_ALL= How is this getting set differently than what I have defined in /etc/ default/init? Is there a graceful way to fix this? I know I can just put "export LC_xxx=xx" into /etc/profile but that seems hackish. |
| |||
| On Wed, 07 May 2008 09:22:31 -0700, Jim Leonard wrote: > How is this getting set differently than what I have defined in /etc/ > default/init? Some application may have set a different locale. See locale(5). > Is there a graceful way to fix this? I know I can just put "export > LC_xxx=xx" into /etc/profile but that seems hackish. You might be able to track where it got changed. From a fresh boot log in on console and see what locale values have been set. As Colin B. indicated it may be Gnome which is doing this; you haven't mentioned what kind of environment you're using. |
| ||||
| On May 7, 1:16 pm, Dave Uhring <daveuhr...@yahoo.com> wrote: > On Wed, 07 May 2008 09:22:31 -0700, Jim Leonard wrote: > > How is this getting set differently than what I have defined in /etc/ > > default/init? > > Some application may have set a different locale. See locale(5). > > > Is there a graceful way to fix this? I know I can just put "export > > LC_xxx=xx" into /etc/profile but that seems hackish. > > You might be able to track where it got changed. From a fresh boot log in > on console and see what locale values have been set. As Colin B. > indicated it may be Gnome which is doing this; you haven't mentioned what > kind of environment you're using. It's no environment, actually (ie. it's a server without a graphical desktop). I'll try to do some digging; thanks for the feedback. |