|
|
1.1 root 1: Posix P1003.2 sort utility from Unix research v10 system.
2:
3: To build it:
4: make sort
5: To test it:
6: make test
7:
8: On many systems, you may be able to make a faster sort:
9: make fast
10: make test
11:
12: File sort.1 is a manual page.
13:
14: ---------------------------------------------------------
15:
16: Extensions to POSIX:
17: Obsolescent features:
18: +pos -pos field specifications
19: -o recognized among file names
20: Traditional features not in POSIX:
21: -M for sorting by month
22: -T for setting temp directory
23: -y for setting memory size
24: -z (ignored)
25: -t may be combined with other options, e.g. -ct:
26: New features:
27: -g like -n, but allows e-format numbers
28: -s stable sort; break ties by original order,
29: not by raw bytes
30:
31: Algorithm: distribution sort, with preconditioning of difficult keys
32: to make them into simple strings.
33: Overlong data spills to intermediate files, where it is
34: sorted by merging.
35:
36: Language: ANSI C.
37:
38: Testing: passes the accompanying sorttest suite, which exercises
39: every line of code, except for
40: option -T
41: some instances of -y
42: error comments
43: interrupt handling
44: excessive exponents (>~1000) in -g
45:
46: Typical problems:
47: On some systems the ANSI standard functions memmove.c
48: and strtoul.c are slow or absent. Code for these
49: functions is included; use it if you have to
50: (see Makefile).
51:
52: The sorttest suite uses awk as described in the
53: Aho/Kernighan/Weinberger book. Older versions of awk
54: may not be adequate.
55:
56: ANSI header files are assumed, but because headers
57: vary among systems, you may have to do some clever
58: rearrangement of #include directives.
59:
60: Notes on "make fast":
61: In extreme cases (very long records in nearly sorted
62: order) the "make fast" sort can run 40% faster than the
63: "make sort" version. It uses a private addition to
64: classic System V stdio, not universally portable.
65: However, if the new function cgets() will compile, it
66: will almost certainly work.
67:
68: Report troubles to:
69: Doug McIlroy
70: 908 582 6050
71: research!doug
72: [email protected]
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.