Variable definitions

A variable definition must appear on a line by itself, in the following form:

Name = Value

In the example above, Name is the variable's title, and Value is the variable's value.

Variable names must begin with an alphabetic character or an underscore (a-z, A-Z, _), and subsequent characters can be any alphanumeric character or an underscore (a-z, A-Z, 0-9, _).

Note: Spaces are not allowed in variable names.

The variable's value consists of all text on the right side of = with leading and trailing whitespace removed. For example,

FirstUSPresident = The Honorable George Washington

The example above defines a variable named "FirstUSPresident" with the value "The Honorable George Washington".

A variable's value can be referenced anywhere in the script after the variable is defined. A variable reference consists of '$' immediately followed by the variable's name in parentheses, as shown below.

$(FirstUSPresident)

A variable reference is replaced by the variable's value. If the variable is defined multiple times in the script, the most recent definition is used. In the example above, the variable reference "$(FirstUSPresident)" would be replaced by "The Honorable George Washington".

See Also

About variables