If … Then … Fi

The If statement can be used to conditionally execute a block of statements.

Syntax

If bool_expression Then
 code;
Elif bool_expression Then		
 code;
Elif bool_expression Then
  code;
Else				
  code;			
Fi;

If bool_expression Then is the first expression.
code; is executed if the first expression is True.
Elif bool_expression Then is the second expression.
code;is executed if the first expression is False and the second is True.
Else is executed if none of the above expressions is True

The instruction If … Then … Fi can contain zero, one or more Elif … Then … parts which specify alternative conditions that are selected if none of the preceding conditions evaluated to True.

The instruction If … Then … Fi can optionally end with an Else … statement, which is executed if none of the preceding conditions evaluated to True.

Please note the closing semicolon of each expression and the closing semicolon after the Fi..

ITP/Server will first evaluate the bool_expression between the If and the Then statement.

The conditional blocks of statements can contain any valid ITP/Server instructions including other conditional statements. The only exception is the Parameter statement, which can only be used at the beginning of the script.