Complex conditions

Control flow / Conditional statements / if/else statements

a=3
b=5
c=7

#(( )) joins the conditions with && and ||, ! negates
if (( c >= a && c >= b )); then
    echo "nothing is larger than c"
fi

if (( !(a >= b || a >= c) )); then
    echo "a is the smallest"
fi

#[[ ]] does the same with strings, ( ) groups the conditions
name="Boris"
if [[ -n $name && ( $name == A* || $name == B* ) ]]; then
    echo "$name starts with A or B"
fi