Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

File Format Reference Pages locale(4)
The <sort_rules> have the following syntax:
keyword, keyword,...,keyword
where keyword is one of the keywords forward, backward, no-substitute, and posi-
tion.
The sort_rules directives are optional. If present, they dene the rules to apply during
string comparison. The number of specied sort_rules directives denes the number
of weights each collating element is assigned; that is, the number of collation orders in
the locale. If no sort_rules directives are present, one forward directive is assumed
and comparisons are made on a character basis rather than a string basis. If present, the
rst sort_rules directive applies when comparing strings using primary weight, the
second when comparing strings using the secondary weight, and so on. Each set of
sort_rules directives is separated by a ; (semicolon). A sort_rules directive consists of
one or more comma-separated keywords. The following keywords are supported:
copy Species the name of an existing locale to be used as the denition of this
category. If you include a copy statement, no other keyword shall be
specied.
forward Species that collation weight comparisons proceed from the beginning of a
string toward the end of the string.
backward
Species that collation weight comparisons proceed from the end of a string
toward the beginning of the string.
no-substitute
Species that substitution operations dened by the substitute statement are
disabled for this collation order.
position Species that collation weight comparisons consider the relative position of
nonignored elements in the string. That is, if strings compare as equal, the
element with the shortest distance from the starting point of the string col-
lates rst.
The forward and backward keywords are mutually exclusive. The following is an
example of the syntax for the sort_rules directives:
order_start forward;backward,no-substitute
The syntax of the collation order statements is as follows:
Each collation element consists of a <character_symbol> specication, followed by whi-
tespace and a set of collation orders.
All characters in the character set must be placed in the collation order, either explicitly,
or implicitly via the ellipsis symbol (...) or by using the UNDEFINED special symbol.
The number of collation order statements must match the order_start specication.
The optional operands for each collation element are used to dene the primary, secondary, or
subsequent weights for the collating element. The special symbol IGNORE is used to indicate a
collating element that is to be ignored when strings are compared.
An ellipsis keyword appearing in place of a collating_element_list indicates the weights are to be
assigned, for the characters in the identied range, in numerically increasing order from the
weight for the character symbol on the left-hand side of the preceding statement.
527188-003 Hewlett-Packard Company 1113