NAME

syspathsubst - resolve system specific paths


SYNOPSIS

syspathsubst [-c components] pathlist [pathlist]

syspathsubst -h | -u | -v


DESCRIPTION

syspathsubst substitutes components into each element in a list of path templates. Typically it is used on networks with multiple operating system and hardware combinations where execution and library paths differ only by a system specific path component. Using this package allows one to more easily specify those paths.

The final list of valid (existent) paths with duplicates removed is output to the standard output stream.

The components to substitute are supplied by default by sysarch (invoked as sysarch -n platforms) but may be explicitly provided via the -p option. They are substituted into path templates in the order in which they are provided. In typical use (and if generated by sysarch) the components are ordered from most specific to most generic.

The set of paths thus created is then filtered for duplicates and then output as a delimited list. Duplicates are determined based on comparisons of the path names, not the fully resolved paths, so that if two paths resolve to the same disk location but one uses symbolic links, they will appear distinct. To avoid this, use a path template token which ensures that links are resolved.


OPTIONS AND ARGUMENTS

syspathsubst takes as arguments one or more colon delimited lists of path templates.

-c list

Specify a colon delimited list of components to substitute into the path templates

-d, --delimiter=DELIM

Use DELIM between output paths. Defaults to a space character.

-h

Output short usage information and exit.

-u

Output full usage information and exit.

-v

Output the version and exit.


PATH TEMPLATES

A path template is a string which can contain zero or one of a set of special tokens. The tokens indicate where in a path the system specific component will be substituted, as well as the value of two attributes, resolvelinks and firstvalid:

  Token   resolvelinks  firstvalid
  -----   -----------  ----------
   %s        false       false
   %p        false       false
   %P        false       true
   %l        true        false
   %L        true        true

If resolvelinks is true, then after substitution any symbolic links in the path are fully resolved. This always results in an absolute path.

If firstvalid is true, then only the first existing path resulting from the in order substitution of the system specific components is retained.

For example, if the list of system specific components is

  c d e f

and the existent paths are

  /a/c /a/e /a/f

Then the path template /a/%p would result in a list of paths

  /a/c:/a/e:/a/f

while the path template /a/%P would result in

  /a/c


COPYRIGHT AND LICENSE

Copyright 2007 The Smithsonian Astrophysical Observatory

This software is released under the GNU General Public License. You may find a copy at: http://www.fsf.org/copyleft/gpl.html


VERSION

This documents version 2.1.27_01.


Author

Diab Jerius <djerius@cfa.harvard.edu>