Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
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 define the rules to apply during
string comparison. The number of specified sort_rules directives defines 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
first 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 Specifies the name of an existing locale to be used as the definition of this
category. If you include a copy statement, no other keyword shall be
specified.
forward Specifies that collation weight comparisons proceed from the beginning of a
string toward the end of the string.
backward
Specifies that collation weight comparisons proceed from the end of a string
toward the beginning of the string.
no-substitute
Specifies that substitution operations defined by the substitute statement are
disabled for this collation order.
position Specifies 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 first.
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> specification, 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 specification.
The optional operands for each collation element are used to define 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 identified range, in numerically increasing order from the
weight for the character symbol on the left-hand side of the preceding statement.
527188-007 Hewlett-Packard Company 11−13