Q: How to specify string ordering with colldef(8)?

Q: How to specify string ordering with colldef(8)?

Post by Dominique Petitpier » Thu, 13 Feb 1992 19:41:54

What I want to do:  sort words according to specific language rules (french,
german, spanish, etc.)

My problem:  how can I specify the sorting rules so that I can use the library
function strcoll(3)?

A little history of my erratic wandering in the manuals:  In SunOs 4.1.1 there
are library functions strcoll(3) and strxfrm(3) that can be used to sort
strings according to specific "national languages".  After some searching
(there is no pointer in the man page), I discovered that there is a library
function setlocale(3V) that one can use with a parameter LC_COLLATE to set the
collating sequence; a description of a standard collating sequences can be
found in /usr/share/lib/locale/LC_COLLATE/default.  Infortunately this is not
a text file and does not help on how to specify a different collating
sequence.  Again there is no pointer on the man page to colldef(8) which I
eventually discovered; colldef(8) is supposed to describe how to specify a
collating sequence.  But frankly it is a bit terse and I was not able to
understand what to do.  There is also the man page locale(5) but of not much
help either.

I wasn't luckier when reading in the "System Services Overview" the section
about "Building a String Collation Table:  colldef(8)".  The example, is
really terse, and again there is no definition of the syntax to use for
specifying a collating sequence (meaning of parentheses, semicolon etc.)
Going back to the beginning of the chapter there is a reference to the "C"
environment, described in Volume 3 of the X/OPEN Programmer's Guide, Issue 2
(XPG2).  The story ends here as this manual is not distributed with the Sun
documentation, and I don't know (yet) how to get a copy.  So, apart from the
very poor cross referencing in Sun's manual pages, there is the more serious
problem that the Sun provided documentation is incomplete!

I would be grateful if you could provide me with some more information,
for example:
   - a definition of the syntax to use for colldef
   - where to get XPG2
   - a complete definition of a collating sequence (standard,
     french, german, spanish)
   - alternative solutions (public domain package for sorting strings
     according to a user specified order).
   - comments on the practicality of strcoll (eg. fast/slow) and colldef
     (what can't you do with it).
   - description of the algorithm used by strcoll.

Thanks in advance!

ISSCO, University of Geneva  | X400: S=petitp;OU=divsun;O=unige;
54 route des Acacias         |       PRMD=switch;ADMD=arcom;C=ch
CH-1227 GENEVA (Switzerland) | UUCP: mcvax!cui!divsun.unige.ch!petitp
Tel: +41/22/705 71 17        | FAX: +41/22/300 10 86


1. RH7.2 : purpose of /etc/nsswitch.conf if DNS is used first regardless of order specified ?


RH7.2 box (has to be 7.2, company policy)

I've got a couple of hosts in my /etc/hosts file

On the resolving front, I have
3 DNS servers in /etc/resolv.conf.

/etc/nsswitch.conf is setup so that for
hosts the /etc/hosts should be tried first
before switching to DNS.

My RH7.2 box is on a remote site from our DNS
servers and the link between the
2 sites (RH7.2 & DNS)is more down than up...

Whenever the link is down, ALL nameresolving
on the 7.2 box is really slow although the resolved
hosts are in /etc/hosts ? In the end, resolving works,
but it is very slow. It would seem all resolving
first goes through the 3 DNS servers in
/etc/resolv.conf and only then is /etc/hosts

What is the purpose of /etc/nsswitch.conf if
DNS is tried first regardless of the order specified
in /etc/nsswitch.conf ??

Any help ?


2. need help with linux authentication of Win95 clients

3. Specify order of files written in CD

4. D-link clone and tulip driver -- help!

5. Specifying Kernel Module Load Order

6. Vtwm for AIX 3.2

7. how to get line number of specified string in a text file

8. ICANN Caught Shilling For Carlyle Re: Top 10 Reasons Why Kabbalahists Post To Usenet Re: PING Kali: Re: digest, volume 2454344

9. How to find a file which contains a specified string?

10. Specify empty string in list

11. how to get line number of specified string in a text file

12. how to find line no. of specified string in a file

13. How to specify a blank in a grep string variable?