1.1. Directive syntax

Configuration directives are normally specified with the directive as the first word on the line, with its value or values following. Capitalization of the directive name is not significant. Leading and trailing whitespace is stripped from the line.

Including files in directives

Additional files may be called with an include file notation like this:

DirectiveName <includefile

Files included from interchange.cfg are relative to the Interchange software directory. Files included from catalog.cfg are relative to the catalog directory.

Here documents

A "here document" can be used to spread directive values over several lines, with the usual Perl <<MARKER syntax. No semicolon is used to terminate the marker. The closing marker must be the only thing on the line. No leading or trailing characters are allowed, not even whitespace. Here is a hypothetical directive using a here document:

        DirectiveName <<EOD
            setting1
            setting2
            setting3
        EOD

That is equivalent to:

        DirectiveName setting1 setting2 setting3

Include single setting from file

        Variable MYSTUFF <file

include

        include common.cfg
        include usertag/*

ifdef and ifndef

        Variable ORDERS_TO email_address
        
        ifdef ORDERS_TO
        ParseVariables Yes
        MailOrderTo __ORDERS_TO__
        ParseVariables No
        endif
        
        ifdef ORDERS_TO =~ /foo.com/
        # Send all orders at foo.com to one place now
        # Set ORDERS_TO to stop default setting
        Variable  ORDERS_TO  1
        MailOrderTo   orders@foo.com
        endif
        
        ifdef ORDERS_TO eq 'nobody@nowhere.com'
        # Better change to something else, set ORDERS_TO to stop default
        Variable  ORDERS_TO  1
        MailOrderTo   someone@somewhere.com
        endif
        
        ifndef ORDERS_TO
        #Needs to go somewhere....
        MailOrderTo  webmaster@localhost
        endif