An environment variable cannot be split across multiple lines.
Both the DOS syntax, using %, and the UNIX shell syntax, using $, for referencing environment variables are supported on both UNIX and DOS. An environment variable name must be atleast one character long and can only contain alphanumeric characters (A-Z, a-z, 0-9) and underscore (_).
An environment variable must be referenced by:
- Prepending it with a $ as in $filename. The first non-alphanumeric and non underscore character, or the end of the line, terminates the name. Thus, filename is the variable name in $filename- and file is the variable name in $file<endofline>
- Prepending it with a $ and enclosing it in braces as in ${abc}
- Enclosing it in %’s as in %abc%.
Any options text that does not match the above rules is not considered a variable name and is not translated. For example, %format-%, ${length<endofline>, and %% are all left as is.
To use a $ sign or a % sign without signifying a run time variable, use $$ or %%. A double $ sign or % sign is replaced with a single $ sign or % sign respectively.