Scripting >> Examples >> Python-Perl-Powershell-Bash-Windows Batch >> Example 005 - Simple IF ELSEIF ELSE block


To perform IF / ELSE / ELSEIF branching.


Examples in Python, Perl, Powershell, Bash and Windows batch.
 

 

 

 

 

 

 

 

 

 

 

 

 

## NOTE
## For Windows Batch
## 1. The ELSE statement must be in the same line as the IF
## so if using () to enclose multiline statements,
## the ELSE must be immediately after the closing )
## 2. No native ELSEIF type of statement, simulated here with
## another inner IF block after the ELSE

 

Sample output - Python

 

Sample output - Perl

 

 

Sample output - Powershell

Sample output - Bash

Sample output - Windows batch