HP-UX Reference (11i v1 00/12) - 1 User Commands N-Z (vol 2)

__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man1/neqn.1
________________________________________________________________
___ ___
s
sort(1) sort(1)
International Code Set Support
Single- and multi-byte character code sets are supported.
EXAMPLES
Sort the contents of infile with the second field as the sort key:
sort -k 2,2 infile
Sort, in reverse order, the contents of infile1 and infile2, placing the output in outfile and
using the first two characters of the second field as the sort key:
sort -r -o outfile -k 2.1,2.2 infile1 infile2
Sort, in reverse order, the contents of infile1 and infile2, using the first non-blank character of the
fourth field as the sort key:
sort -r -k 4.1b,4.1b infile1 infile2
Print the password file (/etc/passwd ) sorted by numeric user ID (the third colon-separated field):
sort -t: -k 3n,3 /etc/passwd
Print the lines of the presorted file
infile, suppressing all but the first occurrence of lines having the
same third field:
sort -mu -k 3,3 infile
DIAGNOSTICS
sort exits with one of the following values:
0 All input files were output successfully, or
-c was specified and the input file was correctly
presorted.
1 Under the
-c option, the file was not ordered as specified, or if the
-c and -u options were
both specified, two input lines were found with equal keys. This exit status is not returned if the
-c option is not used.
>1 An error occurred such as when one or more input lines are too long.
When the last line of an input file is missing a new-line character, sort appends one, prints a warning
message, and continues.
If an error occurs when accessing the tables that contain the collation rules for the specified language,
sort prints a warning message and defaults to the POSIX locale.
If a -d, -f,or -i option is specified for a language with multi-byte characters,
sort prints a warning
message and ignores the option.
WARNINGS
Numbering of fields and characters within fields (
-k option) has changed to conform to the POSIX standard.
Beginning at HP-UX Release 9.0, the -k option numbers fields and characters within fields, starting with
1.PriortoHP-UX Release 9.0, numbering started at 0.
A field separator specified by the -t option is recognized only if it is a single-byte character.
The character type classification categories alpha, digit, space, and print are not defined for
multi-byte characters. For languages with multi-byte characters, all characters are significant in comparis-
ons.
FILES
/var/tmp/stm???
/tmp/stm???
AUTHOR
sort was developed by OSF and HP.
SEE ALSO
comm(1), join(1), uniq(1), environ(5), lang(5).
HP-UX Release 11i: December 2000 4 Section 1889
___
___