sbase/sort.1

89 lines
1.6 KiB
Groff
Raw Normal View History

.Dd 2015-10-08
.Dt SORT 1
.Os sbase
2015-01-30 22:49:13 +00:00
.Sh NAME
.Nm sort
.Nd sort lines
.Sh SYNOPSIS
.Nm
.Op Fl Cbcmnru
.Op Fl o Ar outfile
2015-01-30 22:49:13 +00:00
.Op Fl t Ar delim
.Op Fl k Ar key ...
.Op Ar file ...
.Sh DESCRIPTION
.Nm
writes the sorted concatenation of each
.Ar file
to stdout.
If no
2015-02-01 19:52:28 +00:00
.Ar file
is given
2015-02-01 19:52:28 +00:00
.Nm
reads from stdin.
2015-01-30 22:49:13 +00:00
.Sh OPTIONS
.Bl -tag -width Ds
.It Fl C
2015-02-01 19:52:28 +00:00
Check that the concatenation of the given
.Ar files
is sorted rather than sorting them. In this mode, no output is printed to
stdout, and the exit status indicates the result of the check.
2015-01-30 22:49:13 +00:00
.It Fl b
2015-02-01 19:52:28 +00:00
Skip leading whitespace of columns when sorting.
2015-01-30 22:49:13 +00:00
.It Fl c
2015-02-01 19:52:28 +00:00
The same as
2015-01-30 22:49:13 +00:00
.Fl C
except that when disorder is detected, a message is written to stderr
2014-11-23 19:35:56 +00:00
indicating the location of the disorder.
2015-01-30 22:49:13 +00:00
.It Fl k Ar key
Specify a key definition of the form
2015-01-30 22:49:13 +00:00
.Sm off
2015-02-01 16:45:51 +00:00
.Sy S
.No [.
2015-01-30 22:49:13 +00:00
.Sy s
2015-02-01 16:45:51 +00:00
.No ][
2015-01-30 22:49:13 +00:00
.Sy f
2015-02-01 16:45:51 +00:00
.No ][,
2015-01-30 22:49:13 +00:00
.Sy E
2015-02-01 16:45:51 +00:00
.No [.
2015-01-30 22:49:13 +00:00
.Sy e
2015-02-01 16:45:51 +00:00
.No ][
2015-01-30 22:49:13 +00:00
.Sy f
2015-02-01 16:45:51 +00:00
.No ]]
2015-01-30 22:49:13 +00:00
.Sm on
where
2015-02-01 20:45:35 +00:00
.Sy S , s , E
and
2015-01-30 22:49:13 +00:00
.Sy e
are the starting column, starting character in that column, ending column and
2015-01-30 22:49:13 +00:00
the ending character of that column respectively. If they are not specified,
.Sy s
refers to the first character of the specified starting column,
2015-01-30 22:49:13 +00:00
.Sy E
refers to the last column of every line, and
2015-01-30 22:49:13 +00:00
.Sy e
2015-02-01 16:45:51 +00:00
refers to the last character of the ending column.
2015-01-30 22:49:13 +00:00
.Sy f
can be used to specify options
2015-02-01 20:45:35 +00:00
.Sy ( n , b )
that only apply to this key definition.
2015-01-30 22:49:13 +00:00
.Sy b
is special in that it only applies to the column that it was specified after.
.It Fl m
Assume sorted input, merge only.
2015-01-30 22:49:13 +00:00
.It Fl n
2015-02-01 19:52:28 +00:00
Perform a numeric sort.
.It Fl o Ar outfile
Write output to
.Ar outfile
rather than stdout.
2015-01-30 22:49:13 +00:00
.It Fl r
2015-02-01 19:52:28 +00:00
Reverses the sort.
2015-01-30 22:49:13 +00:00
.It Fl t Ar delim
Set
.Ar delim
as the field delimiter.
2015-01-30 22:49:13 +00:00
.It Fl u
Print equal lines only once.
2015-01-30 22:49:13 +00:00
.El