Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)
locale(4) OSS Shell and Utilities Reference Manual
A character_symbol argument defined by the collating-element statement is recog-
nized only within the LC_COLLATE category.
collating-symbol
The collating-symbol statement is used to specify collation symbols for use in colla-
tion sequence statements.
The syntax for the collating-symbol statement is as follows:
collating-symbol <collating_symbol>
The collating_symbol argument cannot duplicate any symbolic name in the current
charmap file, or any other symbolic name defined in this collation definition. The fol-
lowing are examples of the syntax for the collating-symbol statement:
collating-symbol <UPPER_CASE>
collating-symbol <HIGH>
A collating_symbol argument defined by the collating-symbol statement is recognized
only within the LC_COLLATE category.
substitute
The substitute statement is used to define a substring substitution in a string to be col-
lated.
The syntax for the substitute statement is as follows:
substitute "regular_expr" with "replacement"
The regular_expr argument defines a basic regular expression enclosed in "" (double
quotes). The replacement argument consists of zero or more characters and regular
expression back references (for example, \1 through \9) enclosed in "" (double quotes).
When strings are collated based on a collation definition containing substitute state-
ments, the collation acts as if occurrences of substrings matching the regular_expr
string are replaced by the replacement string in the same manner as the ed command
performs a global substitution. After all substitutions are complete, the strings are
compared based on the specified collation order. Ranges in the regular expression are
interpreted according to the character classification specified by the LC_CTYPE
environment variable at collation time. If more than one substitute statement is
defined in the collation definition, the collation process acts as if the substitute state-
ments are applied to the strings in the order they occur in the source definition.
A regular_expr argument defined by the substitute statement is recognized only with
the LC_COLLATE category.
A situation where substitution is necessary for dictionary order is the expansion of Mc
to Mac in personal names. The following substitute statement performs this substitu-
tion:
substitute "ˆMc\( \{0,1\}\)\([[:upper:]]\)" with " Mac\1\2"
substitute " Mc\( \{0,1\}\)\([[:upper:]]\)" with " Mac\1\2"
order_start
The order_start statement is followed by one or more collation order statements,
assigning collation weights to collating elements. This statement is mandatory.
The syntax for the order_start statement is as follows:
order_start <sort_rules>;<sort_rules>;...;<sort_rules>
collation_order_statements
order_end
11−12 Hewlett-Packard Company 527188-004