---
name: "mkhpath"
section: "8"
platform: "linux"
package: "smail"
version: "3.2.0.115-7.1"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/mkhpath"
---

# mkhpath(8)

produce path data from an /etc/hosts file

## NAME

mkhpath - produce path data from an /etc/hosts file

## SYNOPSIS

**/usr/lib/smail/mkhpath** \[ **-n** *netname* \] \[ **-c** *cost* \] \[ **-g** *gateway* \] \[ **-d** \] \[ **-** \| *filename* \]\

## DESCRIPTION

*Mkhpath* takes as input a *hosts* file, in the format of the 4.3BSD file */etc/hosts*, and creates path data suitable for use by a [*smail*(8)](/smail/8.md) **pathalias** router (see [*smail*(5)](/smail/5.md) for information on routers). The output is also suitable for merging in with the output of [*pathalias*(8)](/pathalias/8.md), and can be made suitable as input to *pathalias*.

The hostnames *localhost* and *loghost* are ignored, as are any domain names (names containing dot characters).

This command is useful for sending information about a network's connectivity to hosts that are not on that network.  As a general rule, the smail **gethostbyname** router driver precludes the need for this tool.

## OPTIONS

The following options are recognized by *mkhpath*:

- **-n** *netname*

  Generate output which is suitable as input to [*pathalias*(8)](/pathalias/8.md) as a description of an interconnected network named *netname* connecting together all hosts named in the *hosts* file.

- **-c** *cost*

  Set the cost for the network gateway to *cost*. This may be any valid *pathalias* cost expression and is only useful with the **-n** option.

- **-g** *gateway*

  Set the gateway for all of the hosts in the *hosts* file to *gateway.* This can be used either with or without the **-n** option.  If neither **-g** nor **-n** are used, then the local host is assumed to connect to all of the hosts directly.

- **-d**

  Only use lines that contain a domain name (i.e., a name containing one or more dots) as one of the names for a host. Such domain names are not used themselves, but lines that do not contain any domain names are ignored.

If a *filename* argument is used, then the host information is read from this file. If an argument of **-** is specified instead, then the standard input is used.  Otherwise the file */etc/hosts* is used to obtain host information.

## SEE ALSO

[*pathalias*(8)](/pathalias/8.md), [*smail*(5)](/smail/5.md), [*smail*(8)](/smail/8.md), [*mkpath*(8)](/mkpath/8.md), and [*pathmerge*(8)](/pathmerge/8.md).

## COPYRIGHT

*Copyright* (C) 1987, 1988 Ronald S. Karr and Landon Curt Noll\
 *Copyright* (C) 1992 Ronald S. Karr

See a file *COPYING*, distributed with the source code, or type *smail -bc*, to view distribution rights and restrictions associated with this software.
