syntax of if-else

if [ expresion ]
then
statement to be executed if expresion is true
else
statement to be executed if expresion is false
fi

Explanation

This espression run if the conditional is true, than it execute the statement 1.
If the result of conditional expression is zero, it jump to "else part" and execute the statement 2. Finally after the execution of if/else, it resume with the consequent statement.

Exemple

#!/bin/sh
var1=10
var2=10 if[ var1==1var2 ]
then
echo "var1 is equal var2"
else
echo "var1 is not equal var2"
fi