if then bash file code example
Example 1: bash if else if
if [[ TEST-COMMAND ]]
then
STATEMENTS1
else
STATEMENTS2
fi
Example 2: codition in bash
# short if codition
[ $(( 2 + 2 )) -eq '4' ] && echo "yes"
# long if codition
if [ $(( 2 + 2 )) -eq '4' ]
then
echo "yess"
fi