Comments are assumed to be lines which start with '#'. Keywords are any sequence of alpha-numerics ( plus '_', '.', '-' ) followed by a comma, space or equals symbol. The remainder of the line (starting from the next alpha-numeric) is assumed to be the value associated with that keyword.
Programs which use the configuration sytem enquire of the value associated with a keyword. There are then routines which will interpret the value and return the result.
A value can be interpreted as:
The following is a more detailed description of these types.An example would be:
MY_NAME=Michael Caine
SCREAM_AT_MONSTER=YES
NUMBER_OF_PROGRAMMERS_TO_CHANGE_LIGHT_BULB=5
PI=3.14159265
LOGFILE=$HOME/logfileand the environment has
HOME=/home/methe result of evaluating LOGFILE would be /home/me/logfile.
There are a couple of other variations which are associated with dynamic evaluation.
FORENAME=Leonardo SURNAME=Da Vinci TITLE=Mr. FULL_NAME=%TITLE %FORENAME %SURNAMEand the environment has
HOME=/home/meThen the results of evaluation are:
KEYWORD | DEFAULT | RESULT |
FULL_NAME | NULL | Mr. Leonardo Da Vinci |
LOGFILE | NULL | NULL |
LOGFILE | $HOME/logfile.%FORENAME | /home/me/logfile.Leonardo |
There is are a couple of additional modes which may be used with evaluated strings.
The first of these is the ability to bracket the word to be referenced. This is done by following the % or $ with either ( or { followed by the keyword, and then a corresponding closing brace character.
As an example,
FORENAME=Harold FULL_NAME=%{FORENAME}123456
The second mode available is that of specifying that a word should be evaluated as a configuration file string (%) and if not present, to be evaluated as an environment string, or vice-versa. This is done simply by placing the two meta-characters one after the other in the required order. i.e.
LOG_DIR=/var/tmp LOG_NAME=$%LOG_DIR/log_namewill attempt to use the value of $LOG_DIR, and if not present use that of %LOG_DIR.