.TH mksort "" "" "Command"
.PC "Sort the standard input, allowing arbitrarily long lines"
\fB/usr/lib/mail/mksort [ \-f ] [ \fIfile ...  \^\fB]\fR
.PP
.HS
.SH Options:
.IC \fB\-f\fR
Fold upper-case text into lower case
.HE
The command
.B mksort
reads lines of text, sorts them by the first field in each line,
then writes them to the standard output.
It usually is used by system administrators to help prepare the data files
used by
.BR smail .
Unlike the \*(CO command
.BR sort ,
.B mksort
can read and process an arbitrarily long line of text.
.PP
The first field within a line of input is delimited either by a white-space
character or a colon `:'.
A line can be of any length, as long as the entire
input can be stored in memory.
Command-lind option
.B \-f
(for ``fold'') tells
.B mksort
to ignore case when it sorts its input; with this option,
the letter `A' equals the letter `a',
and `a' is always less than `B'.
.PP
If its command line does not name an input file,
.B mksort
reads the standard input.
A file name of `-' indicates the standard input;
this permits
.B mksort
to mingle the contents of one or more files with what it reads from
the standard input.
.\".PP
.\"You can use
.\".B mksort
.\"with the command
.\".B mkline
.\"to produce sorted files that contain arbitrarily large aliases,
.\"or paths that can then be read by
.\".BR smail 's
.\"router
.\".B pathalias
.\"or its director
.\".BR aliasfile .
.\"For more information on routers and directors, see the Lexicon entries for
.\".B routers
.\"and
.\".BR directors .
.SH Example
The following example demonstrates how to use
.B mksort
with
.BR mkline .
Consider file
.BR aliases ,
which contains the following aliasing information:
.DM
	Postmaster:hustead # Ted Hustead, jr.
	UUCP-Postmasters: tron, chongo   # namei contacts
	    yamato  # kremvax contact
	tron:      tron@namei.uucp (Ronald S. Karr)
	yamato:    yamato@kremvax.ussr.comm (Yamato T. Yankelovich)
	chongo:    chongo@eek.uts.amdahl.com (Landon Curt Noll)
.DE
.PP
Given this file, the command
.DM
	mkline aliases | mksort -f
.DE
.PP
yields:
.DM
	chongo:chongo@eek.uts.amdahl.com
	Postmaster:hustead
	tron:tron@namei.uucp
	UUCP-Postmasters:tron,chongo yamato
	yamato:yamato@kremvax.ussr.comm
.DE
.SH "See Also"
.Xr "commands," commands
.Xr "mail [overview]," mail.o
.Xr "mkline," mkline
.Xr "mkdbm," mkdbm
.Xr "pathalias," pathalias
.Xr "smail" smail
.SH Notes
This command is not used by \*(CO's implementation of
.BR smail .
.PP
Copyright \(co 1987, 1988 Ronald S. Karr and Landon Curt Noll.
Copyright \(co 1992 Ronald S. Karr.
.PP
For details on the distribution rights and restrictions
associated with this software, see file
.BR COPYING ,
which is included with the source code to the
.B smail
system; or type the command:
.BR "smail \-bc" .
