


MKPATH(8)                                               MKPATH(8)


NNAAMMEE
       mkpath - make a pathalias output file

SSYYNNOOPPSSIISS
       //uussrr//lliibb//mmaaiill//mmkkppaatthh [--vv] [--VV] [--xx] [--ee] [--nn] [ --tt _t_r_a_c_e ]
       [ _p_a_t_h___c_o_n_f_i_g ]
       //uussrr//lliibb//mmaaiill//ddccaasseehhoosstt [ --cc ]

DDEESSCCRRIIPPTTIIOONN
       _M_k_p_a_t_h creates _p_a_t_h_a_l_i_a_s(8) output given  a  configuration
       file that describes the various sources of input that will
       be used in generating this output, and how  these  sources
       of  input  are to be used.  The name of this configuration
       file is given as the _p_a_t_h___c_o_n_f_i_g argument.  If _p_a_t_h___c_o_n_f_i_g
       is --, then a specification will be taken from the standard
       input.  If _p_a_t_h___c_o_n_f_i_g is omitted, then the default speci-
       fication  _/_u_s_r_/_l_i_b_/_m_a_i_l_/_m_a_p_s_/_m_k_p_a_t_h_._c_o_n_f  is used.  Unless
       redirected in the configuration file, path data is written
       to the standard output.

       _D_c_a_s_e_h_o_s_t  converts  the hostname in a stream of pathalias
       data to lower case.  Normally, dcasehost assumes that  the
       hostname is in the first field in each line, where a field
       is delimited by whitespace.  If the --cc  option  is  speci-
       fied,  then  the  hostname  is assumed to be in the second
       field.  This is for compatibility with the  --cc  option  to
       _p_a_t_h_a_l_i_a_s(8).   See the pathalias man page for more infor-
       mation.

       The _d_c_a_s_e_h_o_s_t command is intended to be used  only  within
       the _m_k_p_a_t_h command.

CCOONNFFIIGGUURRAATTIIOONN FFIILLEE FFOORRMMAATT
       The  format  of  the  path  configuration file is a set of
       lines containing directives.  Blank lines are ignored  and
       the character ``#'' begins a comment which continues until
       the end of the line.  The various possible directives  are
       described below.

       In these directive descriptions, an argument of _a_r_g refers
       to one of the following types of arguments:

       '_l_i_t_e_r_a_l'        Literal data specified  inline.   (single
                        quotes)

       `_s_h_e_l_l_-_c_o_m_m_a_n_d`  Take  data  from  the  standard output of
                        this shell command.  (back quotes)

       _f_i_l_e_n_a_m_e _._._.     Take data from the named file  or  files.
                        Files  may be specified using shell glob-
                        bing notation, with ** ??  and [[]].

       The `_s_h_e_l_l_-_c_o_m_m_a_n_d` form preserves newlines and whitespace
       and  is  thus  not  entirely equivalent to usage in _s_h(1).



Local                    31 January 1988                        1





MKPATH(8)                                               MKPATH(8)


       The following lines result in the same input to pathalias:

            map   `cat food`    # ackpft!
            map   food          # oop ack!

       For  the `_s_h_e_l_l_-_c_o_m_m_a_n_d` and '_l_i_t_e_r_a_l' forms, the filename
       used for error messages is _[_s_t_d_i_n_].

       mmaapp _a_r_g
              Specify map data to be given as input to pathalias.
              Each file is preceded by a line containing:

                   file { _p_a_t_h_n_a_m_e }

              where  _p_a_t_h_n_a_m_e  is  the full pathname to the file.
              This will cause error messages  from  pathalias  to
              refer  to  the correct file.  Each file is followed
              by the line containing:

                   private {}

              to force the end of scope for  any  pprriivvaattee  direc-
              tives within the map files.

       ssaaffeemmaapp   _a_r_g
              This  is  similar  to the mmaapp directive, and can be
              used when you do not have sufficient  control  over
              what the files contain.  If a map file contains the
              pathalias  directives  ddeelleettee  and  aaddjjuusstt,   those
              directives  are  removed  and  flagged  as  errors,
              before the file is passed to pathalias.  If  a  map
              file  contains  pathalias  ffiillee  directives,  those
              directives are simply removed.  No error message is
              produced in this case.

       ddeelleettee _a_r_g
              Specify  hosts,  links  or networks which are to be
              deleted at this point.  That is, all previous  ref-
              erences to any of these items will be forgotten.

       aaddjjuusstt _a_r_g
              Specify  hosts  or networks that add on a surcharge
              to any route though them.  By  default,  this  sur-
              charge  is  4000.   Costs can also be added to each
              site as with pathalias.  For example, the following
              is a valid adjust file:

                   walldrug glotz              # default surcharge of 4000
                   kgbvax(1000), kremvax(DEAD) # surcharge of 1000 & DEAD
                   nsavax(FAST)                # reduces cost, FAST < 0

              Be  careful  when using negative adjust surcharges.
              The pathalias program will complain if a cost of  a
              link drops below zero.



Local                    31 January 1988                        2





MKPATH(8)                                               MKPATH(8)


       ddeeaadd _a_r_g
              Specify  hosts,  links  or networks which are to be
              assigned a cost of DEAD.

       tteexxtt _a_r_g
              Within an execution block,  described  in  a  later
              section,  the  given  specified text is sent as the
              standard input to a pathalias command.   Otherwise,
              it is written to the standard output for the _m_k_p_a_t_h
              command.

       ffiillee _f_i_l_e_n_a_m_e
              Set the file to be used by pathalias for error mes-
              sages,  starting  on  the  next  line  of pathalias
              input.  The next line will be  reported  as  if  it
              came from the first line of the file _f_i_l_e_n_a_m_e.  The
              ffiillee command does _n_o_t change where  pathalias  will
              read  next,  only  what  pathalias  calls  the line
              should an error occur.

       ccdd [ _d_i_r ]
              By default, the current directory  used  by  _m_k_p_a_t_h
              begins  in the directory of the configuration file,
              or in the current directory if the configuration is
              read from the standard input.  The ccdd command with-
              out a _d_i_r argument changes to  the  directory  from
              which  _m_k_p_a_t_h  was invoked.  A _d_i_r arg of -- changes
              the directory to the default directory based on the
              name  of  the  configuration  file.  Otherwise, _d_i_r
              becomes the current directory for  file  and  shell
              command references.

       sshh _c_m_d The given shell command is executed.

       ppaatthhaalliiaass _f_l_a_g_s
              Process  the  pathalias  input directives that have
              been collected since the last ppaatthhaalliiaass or ppaatthhssoorrtt
              directive and execute the _p_a_t_h_a_l_i_a_s(8) command with
              this input.  The specified _f_l_a_g_s are given as argu-
              ments  to  pathalias.  These flags can also contain
              i/o redirection, or pipes to other shell  commands.
              For  example, the following is an acceptable use of
              the ppaatthhaalliiaass directive:

                   pathalias -l hostname | mkdbm -o paths

       ppaatthhssoorrtt [ _f_l_a_g_s ]
              This is equivalent to the following directive:

                   pathalias -i -D | dcasehost  |  sort  -T  /tmp
                   _f_l_a_g_s ...

              An  example of a potentially useful ppaatthhssoorrtt direc-
              tive is:



Local                    31 January 1988                        3





MKPATH(8)                                               MKPATH(8)


                   pathsort | sed 's/!foo!/!foobar!/'
              A ppaatthhssoorrtt directive is assumed to follow  the  end
              of  a  configuration  file if an execution block is
              not terminated prior to the end of file.

EEXXEECCUUTTIIOONN BBLLOOCCKKSS
       Directives  are  executed  in  blocks.   A  mmaapp,  ssaaffeemmaapp,
       ddeelleettee,  aaddjjuusstt,  ddeeaadd  or  ffiillee directive starts a block.
       Successive directives continue it.  A ppaatthhaalliiaass  or  ppaatthh--
       ssoorrtt  directive ends a block.  The end of a file can end a
       block, generating an implicit ppaatthhssoorrtt directive.

       Encountering the end of a block normally  results  in  the
       execution  of  a  _p_a_t_h_a_l_i_a_s(8)  command.  The exception is
       when a end of block command is  read  when  no  block  was
       started.  In this case the block is ignored.

       When  the  start  of a block is seen, all directives up to
       the end of the  block  are  collected  and  fed  into  the
       resulting _p_a_t_h_a_l_i_a_s(8) command.  Directives such as ccdd, sshh
       or tteexxtt within a block only effect that block.  Therefore,
       a  ccdd directive within a block will only change the direc-
       tory for the remainder of that block, whereas a ccdd  direc-
       tive outside of a block has a global effect.

       Additionally a tteexxtt or sshh directive will feed its standard
       output into the  block's  pathalias  command  when  it  is
       inside  a block, while a tteexxtt or sshh directive outside of a
       block will send its output direct to the  standard  output
       of  the  _m_k_p_a_t_h command.  This later effect allows for the
       injection of literal  pathalias  output  into  the  output
       stream.

OOPPTTIIOONNSS
       The following options are recognized by _m_k_p_a_t_h:

       --vv     The  internal _s_h(1) commands are executed with a --vv
              option, thus echoing the commands that are piped to
              the shell prior to their being processed.

       --VV     Tell any pathalias commands to produce verbose mes-
              sages.

       --xx     Pass the --xx flag to invocations of the shell, caus-
              ing  commands  which  are  about  to  execute to be
              echoed.

       --ee     Pass the --ee flag to invocations of the shell, caus-
              ing  shells  to  exit  whenever a command returns a
              non-zero exit status.  In addition, the _m_k_p_a_t_h pro-
              gram will exit when it encounters a syntax error or
              unknown directive.

       --nn     Disable the execution of any  shell  commands  that



Local                    31 January 1988                        4





MKPATH(8)                                               MKPATH(8)


              _m_k_p_a_t_h  generates.   This  is  useful  with  the --vv
              option and disables the --xx, --ee and --VV options.

       --tt _t_r_a_c_e
              Cause the input to pathalias to be copied into  the
              file _t_r_a_c_e.


EEXXAAMMPPLLEESS
       Here is a simple example of a _m_k_p_a_t_h configuration file:

              # world.conf - configure our map setup to build world.map

              # get the usenet world maps
              cd      /usr/spool/uumaps
              safemap [ud].*

              # merge in the new maps
              cd      /usr/lib/smail/maps
              safemap newmap/*.map

              # delete our site and merge our private map data
              delete  `uuname -l`
              map     world.map private.map tweak.map

       This  configuration  file  can  be used for a UUCP gateway
       host:

              # Pathalias database for a UUCP gateway

              # map information is stored under this directory
              cd /usr/lib/smail

              # build paths to USENET hosts
              map       usenet/[du].*     # grab all published maps, start of block
              delete    `uuname -l`       # delete published references to our site
              dead      dead              # links and sites with cost of DEAD
              map       ourmap            # add our up-to-date map file
              pathsort  > paths.global    # end of block

              # build paths for our local domain
              map       local.map         # major domain info, start of block
              cd        ../uts            # cd only affects this block
              map       domain.map        # map for uts.amdahl.com domain
              adjust    'flaky'           # add 4000 to routes thru _f_l_a_k_y
              adjust    'flako(HOURLY)'   # add HOURLY to routes thru _f_l_a_k_o
              pathsort  > paths.local     # end of block

              # build a sorted forces file, from the source forces file
              sh        mkline -t forces | dcasehost | sort -u +0 -1 > forces.sort

              # output paths and clean up
              sh        pathmerge forces.sort paths.local paths.global
              sh        rm -f forces.sort paths.local paths.global  # cleanup



Local                    31 January 1988                        5





MKPATH(8)                                               MKPATH(8)


SSEEEE AALLSSOO
       _p_a_t_h_a_l_i_a_s(8), _m_k_l_i_n_e(8), _m_k_d_b_m(8), _m_k_h_p_a_t_h(8), _m_k_u_u_w_h_o(8),
       _s_o_r_t(1), _s_h(1), _s_m_a_i_l(5), _s_m_a_i_l(8) and _p_a_t_h_m_e_r_g_e(8).

BBUUGGSS
       The  first  ``#''  character  on  a  line begins a comment
       regardless of whether or not it is within quotes.

       The --ee option does not stop all  execution,  only  command
       execution  within  an  instance  of  the  shell created by
       _m_k_p_a_t_h.

       Continuation lines are not currently allowed in  the  con-
       figuration file.  Each command must be on a single line.

       For  errors reported by pathalias for input that came from
       the configuration file itself, the line number reported is
       likely  to be incorrect, because the pathalias _f_i_l_e cannot
       be used to set a line number within the file.

       If both --VV and --tt are used, the --VV option must precede  --tt
       ..

CCOOPPYYRRIIGGHHTT
       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  _s_m_a_i_l  _-_b_c  for distribution rights and restrictions
       associated with this software.




























Local                    31 January 1988                        6


