Configuration file format -- Variable Expansion

ht://Dig Copyright © 1995-2002 The ht://Dig Group
Please see the file COPYING for license information.


Attribute values can contain references to other attributes. This is done similarly to how Perl, Bourne shell, and Makefiles use variables. The variables that are referenced will be expanded when the variable is used, not when it is defined. This means that attributes don't have to be defined in the order that they are used.

Example attribute reference in an attribute value:

database_base: ${database_dir}/htdig

or

database_base: $database_dir/htdig

Many default values use the attribute expansion mechanism to make configuration easier and more generic.

In addition to variable expansion, it is also possible to include the contents of a file as the value of an attribute. This is done by putting the filename in backquotes (`). Within the backquotes, variable expansion will still work so that files can be specified relative to some path. The backquotes and the filename will be replaced by the contents of the file if it exists. All whitespace (spaces, tabs, newlines, etc) in the file are condensed to one space before the substitution takes place. The following are some examples of the use of the backquoting scheme:

start_url: `${common_dir}/starting_points`
limit_urls_to: `${common_dir}/limit_list`

Last modified: $Date: 2002/02/01 05:35:21 $
SourceForge Logo