.TH mkhpath "" "" "Command"
.PC "Build a pathalias data base from a hosts table"
.nf
\fB/usr/lib/mail/mkhostpath [\-d] [\-c \fIcost\^\fB] [\-g \fIgateway\^\fB] [\-n \fInetname\^\fB] [ \- | \fIfilename\^\fB ]\fR
.PP
.HS
.SH Options
.IC "\fB\-c \fIcost\fR"
Set the cost of accessing the gateway to \fIcost\fR
.IC "\fB\-d\fR"
Print a line only if it contains a domain host name
.IC "\fB\-g \fIgateway\fR"
Make \fIgateway\fR the gateway to the hosts
.IC "\fB\-n \fInetname\fR"
Form a network map and name the network \fInetname\fR
.HE
The script
.B mkhpath
reads a hosts table and constructs routes to that network.
.I filename
holds the hosts table; if it is `-',
.B mkhpath
reads the standard input.
If the command line does not name a
.IR filename ,
.B mkhpath
reads file
.BR /etc/hosts .
.PP
.B mkhpath
assumes its input to be in the format of the data-base file
.BR /etc/hosts .
It ignores the first field (Internet address) and any
domain-based name (any field containing a `.').
It also ignores the hosts
.B localhost
and
.BR loghost ,
and all comment lines (those that begin with a `#').
.PP
.B mkhpath
recognizes the following command-line options:
.IP "\fB\-c \fIcost\fR"
Set the cost of accessing the gateway to be
.IR cost .
.I cost
can be any cost expression recognized by the command
.BR pathalias .
.B mkhpath
ignores this option if you do not also use option
.BR \-n .
.IP "\fB\-d\fR"
Print a line only if it contains a domain host name.
This is useful for ignoring test lines.
.IP "\fB\-g \fIgateway\fR"
Make
.I gateway
the gateway to the hosts.
.IP "\fB\-n \fInetname\fR"
Form a network map instead a list of path aliases, and name the network
.IR netname .
If you do not use this option,
.B mkhpath
assumes that your local host is within the network, and therefore inserts
your local host into the network list.
It also assumes that the cost of routes within the network is
.BR LOCAL ,
unless you use option
.B \-c
to set the cost of the routes explicitly.
.PP
By default,
.B mkhpath
builds the route table in the same format as that generated by command
.B pathalias
with its option
.BR \-i .
Flag
.B \-n
overrides this default.
.PP
If you use neither option
.B \-g
nor
.BR \-n ,
.B mkhpath
constructs direct routes from your local host to each remote host.
.PP
If you use option
.B \-g
but do not use option
.BR \-n ,
.B mkhpath
prefixes every route to the network (except for the route to the gateway)
with the route \fIgateway\fB!\fR.
.PP
If you use the option
.BR \-n ,
.B mkhostpath
builds a pathalias map to the network this option names.
The format of the map depends on whether you also use option
.BR \-g .
.PP
If you use both options
.B \-g
and
.BR \-n ,
.B mkhpath
establishes the route from your local host to
.IR gateway ,
and inserts the gateway into the network list.
It does not add your local host to the network list,
even if it appears as a site within the hosts table.
It sets the cost of the link between your local host and the gateway is
.BR LOCAL ;
you can override this by using option
.BR \-c .
It fixes at
.B LOCAL
the cost of routes inside the network;
this is not affected by the option
.BR \-c .
.SH "See Also"
.Xr "commands," commands
.Xr "hosts," hosts
.Xr "mail [overview]," mail.o
.Xr "smail" smail
.SH Notes
Please note that because \*(CO does not yet support networking,
this command is never used.
