MPE/iX Shell and Utilities Reference Manual, Vol 2

sort(1) MPE/iX Shell and Utilities sort(1)
–n assumes that the field contains an initial numeric value. sort sorts first by numeric
value and then by the remaining text in the field according to options. This option
treats a field which contains no digits as if it had a value of zero.
–o outfile
writes output to the file outfile. By default, sort writes output onto the standard out-
put. The output file can be one of the input files. In this case, sort makes a copy of
the data to allow the (potential) overwriting of the input file.
–r reverses the order of all comparisons so that sort writes output from largest to
smallest rather than smallest to largest.
–t char
indicates that the character char separates input fields. When you do not specify the
–t option, sort assumes that any number of white space (blank or tab) characters
separate fields.
–u ensures that output records are unique. If two or more input records have equal sort
keys, sort writes only the first record to the output. When you use –u with –c,
sort prints a diagnostic message if the input records have any duplicates.
–y[n] restricts the amount of memory available for sorting to n K of memory (where a K of
memory is 1024 bytes). If n is missing, sort chooses a reasonable maximum
amount of memory for sorting, dependent upon system configuration. sort needs at
least enough memory to hold five records simultaneously. If you try to request less,
sort automatically takes enough. When the input files overflow the amount of
memory available, sort automatically does a polyphase merge (external sorting) al-
gorithm which is, of necessity, much slower than internal sorting. When you use –u
with –c, sort prints a diagnostic message if the input records have any duplicates.
Using the –y option may therefore improve sorting performance substantially for
medium to large input files.
–zn indicates that the longest input record (including the newline character) is n charac-
ters in length. By default, record length is limited to LINE_MAX.
+startposition[endposition]
is an obsolete method of specifying a sorting key. See the Sorting Keys section of
this man page for more information.
The –b, –d, –f, –i, –M, –n, –r, and –t options control the way in which sort compares
records to determine the order in which the records are written to the output. These ordering
options apply globally to all sorting keys except those keys for which you individually specify
the ordering option. For more on sorting keys, see the next section.
1-560 Commands and Utilities