Path: utzoo!censor!geac!torsqnt!lethe!becker!ncrcan!scocan!larryp From: larryp@sco.COM (Larry Philps) Newsgroups: comp.unix.sysv386 Subject: Re: SCO UNIX (3.2.2) 'ls' is broken... what a shame Keywords: ls SCO shame Message-ID: <1991Jan03.143742.23436@sco.COM> Date: 3 Jan 91 14:37:42 GMT References: <41@esacs.UUCP> Sender: news@sco.COM (News administration) Organization: SCO Canada, Inc. Lines: 95 pizzi@esacs.UUCP (Riccardo Pizzi) writes: > >We installed recently the new SCO UNIX release, i.e. 3.2.2. > >Please, look at the output of the 'lc' command on my home directory: > >AAA house.c mbox remind22.5 sps.2 >active.uunet hv@uwasa.fi mte215.zip.1 s.c sps.3 >alt.groups hv@uwasa.fi.h mte215.zip.2 sb.1 sucker >anonftp.sites i2u.info.h nws sb.2 TTT >batchout.c i2u.info.i periodic sb.3 T1500.uunet >casa maild prog sb.5 uunet.games >ciuccia maild.c remind22.1 sb.6 uunet.unix >conq4 Makefila remind22.2 sb.7 uunet.x >ftp-server.h makefile remind22.3 sig >gifhelp Makefile remind22.4 sps.1 > >In the ASCII character set, I have always thought the capital (upper case) >letters should come *before* the lower case letters, but this seems not true >for SCO... >If we look at the following files: maild.c, Makefile, makefile e Makefila, >we would expect to see the following: > > Makefila > Makefile > maild.c > makefile > >now, take a look and see how SCO sorted the files... >The first problem that comes to my mind is that the old habit of giving >important files an uppercase name (or capitalized, as you prefer) does not >work here... what a shame! >I thought the bug could depend on the internationalization stuff, but never Bingo. >had the time to dig into it to debug the problem (I don't like SCO UNIX >at all, agreeing with most developers out there so I don't want to do it, too). > >BTW: today I found that the numbers always come *after* all other letters: This is not a bug, rather a feature :-). Under the ANSI and XPG3 internationalization (I18N for short), practically everything is variable. There are languages out there in which words are sorted by the *first vowel in a word* rather than the first letter. Some letters have to be treated as 2, some strings have to be treated as a single letter. It goes on and on. The whole thing is incredibly complicated. Anyway, what you have done is set your default environment to english_us.8859, rather than english_us.ascii. Thus you have asked for ISO 8859 sorting rules rather than ascii sorting rules, and are getting case independent sorting among other things. I was also confused when this happened the first time. You can do lots of things to solve this (as is typical in I18N) 1) Edit /etc/default/lang, and change the 8859 to ascii. This changes the default behaviour for the *entire* system. 2) Set the environment variable LANG from your shell % setenv LANG english_us.ascii to change just the behaviour you see, but leave everything else alone. 3) Set the environment variable LC_COLLATE (it controls sorting criteria) from your shell % setenv LC_COLLATE english_us.ascii Then your environment will use 8859 rules except for sorting, which will change to the ascii conventions. Have fun. --- I am not an I18N expert, but have actually written code during a project to use this stuff. I found myself confused for months about the *right* way to do things. If anyone else out there has done any I18N programming (under SCO or any other system) and has some *pearls of wisdom* (complaints?) to impart, I would be happy to listen to them. I don't promise to be able to solve, fix or change anything, but I18N is virtually certain to affect my life as a programmer more and more as time goes on, and I would not mind getting a bit of a head start. --- Larry Philps, SCO Canada, Inc (Formerly: HCR Corporation) Postman: 130 Bloor St. West, 10th floor, Toronto, Ontario. M5S 1N5 InterNet: larryp@sco.COM or larryp%scocan@uunet.uu.net UUCP: {uunet,utcsri,sco}!scocan!larryp Phone: (416) 922-1937 Fax: (416) 922-8397