Go to the first, previous, next, last section, table of contents.


Variable expansion

`$foo' or `${foo}' in a path element is replaced by (1) the value of an environment variable `foo' (if defined); (2) the value of `foo' from `texmf.cnf' (if defined); (3) the empty string.

If the character after the `$' is alphanumeric or `_', the variable name consists of all consecutive such characters. If the character after the `$' is a `{', the variable name consists of everything up to the next `}' (braces may not be nested). Otherwise, Kpathsea gives a warning and ignores the `$' and its following character.

You must quote the $'s and braces as necessary for your shell. Shell variable values cannot be seen by Kpathsea, i.e., ones defined by set in C shells and without export in Bourne shells.

For example, given

setenv tex /home/texmf
setenv TEXINPUTS .:$tex:${tex}prev

the final TEXINPUTS path is the three directories:

.:/home/texmf:/home/texmfprev

The `.progname' suffix on variables and `_progname' on environment variable names are not implemented for general variable expansions. These are only recognized when search paths are initialized (see section Path sources).

Variable expansion is implemented in the source file `kpathsea/variable.c'.


Go to the first, previous, next, last section, table of contents.