Specifications

140 Version 2.0
if
Controls which script commands will be executed based on provided conditional
expressions.
Usage
if [not] exist filename then
command [arguments]
[command [arguments]]
[else
command [arguments]
[command [arguments]]
]
endif
if [/i] [not] string1 == string2 then
command [arguments]
[command [arguments]]
[else
command [arguments]
[command [arguments]]
]
endif
if [/i][/s] ConditionalExpression then
command [arguments]
[command [arguments]]
[else
command [arguments]
[command [arguments]]
]
Endif
Options
ConditionalExpression
Conditional expression, as described in “Expressions”, below.
Description
The if command executes one or more commands before the else or endif
commands, if the specified condition is true; otherwise commands between else (if
present) and endif are executed.
In the first usage of if, the exist condition is true when the file specified by filename
exists. The filename argument may include device and path information. Also wildcard
expansion is supported by this form. If more than one file matches the wildcard
pattern, the condition evaluates to TRUE.