Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)
Table Of Contents
User Commands (s) sort(1)
/*
* -ka.b,c.d = if d==0 then +(a-1).(b-1) -c.d
* else +(a-1).(b-1) -(c-1).d
*/
-m Merges only (assumes sorted input).
-n Sorts any initial numeric strings (consisting of optional spaces, optional dashes, and
zero or more digits with optional radix character and thousands separator, as defined by
the current locale) by arithmetic value. An empty digit string is treated as zero; leading
zeros and signs on zeros do not affect ordering.
-o output_file
Directs output to output_file instead of standard output. output_file can be the same as
one of the input files.
-r Reverses the order of the specified sort.
-t character
Sets the field separator character to character. The character argument is not con-
sidered to be part of a field (although it can be included in a sort key). Each occurrence
of character is significant (for example, two consecutive occurrences of character del-
imit an empty field). To specify the tab character as the field separator, you must
enclose it in ’’(single quotes).
The default field separator is one or more spaces.
-T directory
Places all the temporary files that are created in directory.
-u Suppresses all but one in each set of equal lines. Ignored characters (such as leading
tabs and spaces) and characters outside of sort keys are not considered in this type of
comparison.
If used with the -c flag, -u checks that there are no lines with duplicate keys, in addition
to checking that the input file is sorted.
-y [kilobytes]
Starts the sort command using kilobytes of main storage and adds storage as needed.
(If kilobytes is less than the minimum storage size or greater than the maximum, the
minimum or maximum is used instead.) If the -y flag is omitted, the sort command
starts with the default storage size; -y 0 starts with minimum storage, and -y (with no
value) starts with the maximum storage. The amount of storage used by the sort com-
mand has a significant impact on performance. Sorting a small file in a large amount of
storage is wasteful.
-z record_size
Prevents abnormal termination if lines being sorted are longer than the default buffer
size can handle. When the -c or -m flags are specified, the sorting phase is omitted and
a system default size buffer is used. If sorted lines are longer than this size, sort ter-
minates abnormally. The -z option specifies that the longest line be recorded in the sort
phase so that adequate buffers can be allocated in the merge phase. record_size must
be a value in bytes equal to or greater than the number of bytes in the longest line to be
merged.
+fskip.cskip
Specifies the start position of a key field. See the -k flag for a description of the current
way to perform this operation. (Obsolescent)
527188-003 Hewlett-Packard Company 8−45