|
1 | | -.\" $NetBSD: sort.1,v 1.47 2026/01/17 21:49:02 uwe Exp $ |
| 1 | +.\" $NetBSD: sort.1,v 1.48 2026/01/18 19:16:18 jkoshy Exp $ |
2 | 2 | .\" |
3 | 3 | .\" Copyright (c) 2000-2003 The NetBSD Foundation, Inc. |
4 | 4 | .\" All rights reserved. |
|
59 | 59 | .\" |
60 | 60 | .\" @(#)sort.1 8.1 (Berkeley) 6/6/93 |
61 | 61 | .\" |
62 | | -.Dd January 17, 2026 |
| 62 | +.Dd January 18, 2026 |
63 | 63 | .Dt SORT 1 |
64 | 64 | .Os |
65 | 65 | .Sh NAME |
66 | 66 | .Nm sort |
67 | | -.Nd sort or merge text files |
| 67 | +.Nd sort, merge or checked the sortedness of text files |
68 | 68 | .Sh SYNOPSIS |
69 | 69 | .Nm |
70 | | -.Op Fl bdfHilmnrSsu |
| 70 | +.Op Fl bdfHilnrSsu |
| 71 | +.Oo |
| 72 | +.Fl k |
| 73 | +.Ar kstart Ns Oo Cm \&, Ns Ar kend Oc Ar ... |
| 74 | +.Oc |
| 75 | +.Op Fl o Ar output |
| 76 | +.Op Fl R Ar char |
| 77 | +.Op Fl T Ar dir |
| 78 | +.Op Fl t Ar char |
| 79 | +.Op Ar |
| 80 | +.Nm |
| 81 | +.Fl m |
| 82 | +.Op Fl bdfHilnrSsu |
71 | 83 | .Oo |
72 | 84 | .Fl k |
73 | 85 | .Ar kstart Ns Oo Cm \&, Ns Ar kend Oc Ar ... |
|
90 | 102 | .Sh DESCRIPTION |
91 | 103 | The |
92 | 104 | .Nm |
93 | | -utility sorts text files by lines. |
| 105 | +utility performs one of three operations on its input files: |
| 106 | +.Bl -enum |
| 107 | +.It |
| 108 | +If none of the options |
| 109 | +.Fl C , |
| 110 | +.Fl c |
| 111 | +or |
| 112 | +.Fl m |
| 113 | +are specified, the |
| 114 | +.Nm |
| 115 | +utility will sort the lines of the specified input files together and |
| 116 | +write the result to the specified output. |
| 117 | +.It |
| 118 | +If the |
| 119 | +.Fl m |
| 120 | +option is specified, the |
| 121 | +.Nm |
| 122 | +utility will merge the lines of the specified input files and |
| 123 | +write the result to the specified output. |
| 124 | +The input files are expected to be presorted for this mode of |
| 125 | +operation. |
| 126 | +.It |
| 127 | +If either of the |
| 128 | +.Fl C |
| 129 | +or |
| 130 | +.Fl c |
| 131 | +options are specified, the |
| 132 | +.Nm |
| 133 | +utility will indicate by its exit status whether a single input file |
| 134 | +is correctly sorted. |
| 135 | +.El |
| 136 | +.Pp |
94 | 137 | Comparisons are based on one or more sort keys extracted |
95 | 138 | from each line of input, and are performed lexicographically. |
96 | 139 | By default, if keys are not given, |
|
0 commit comments