Environment variables and escaping characters

The Probe Rules Utility tool recognizes only certain formats for environment variables. Escaping of certain characters is not supported.

Environment variables

The Probe Rules Utility recognizes the following environment variable formats:
  • $ENV_VAR_NAME
  • %ENV_VAR_NAME%
  • ${ENV_VAR_NAME}

These formats apply to include and lookup statements in rules files, and to properties specified in the nco_rules_util.props file.

The tool looks up the value specified by the environment variable and replaces it with the variable contents. If the environment variable does not exist, it is replaced by an empty string.

For example, assume that $NC_RULES_HOME is set to /var/rulesfiles and a rules file contains the following statement:

include $NC_RULES_NOME/subdir/some.include

The tool parses the statement as include /var/rulesfiles/subdir/some.include.

Note: If your rules files contain environment variables, you must set those variables before you run the Probe Rules Utility so that it can resolve them.

Escaping characters

The Probe Rules Utility does not recognize escaping of the following characters: $, %, {, or }.

For example, in the following include statement, the tool does not escape the $ character but instead parses $name as an environment variable:

include /random/file\$name/the.rules

These escaping restrictions apply to include and lookup statements in rules files, and to properties specified in the nco_rules_util.props file.