4. Conditionals

4.1. if

name="José Jiménez"

if [ $imie == "José Jiménez" ]; then
    echo "My name José Jiménez"
fi

4.2. if and else

name="José Jiménez"

if [ $imie == "José Jiménez" ]; then
    echo "My name José Jiménez"
else
    echo "I am someone else"
fi

4.3. Short version - && and ||

$ name="José Jiménez"
$ [ $imie == "José Jiménez" ] && echo "My name José Jiménez" || echo "I am someone else"
My name José Jiménez

4.4. Case (A.K.A. switch)

case $( arch ) in   # $( arch ) returns machine architecture.
                    # Equivalent to 'uname -m' ...
  i386 ) echo "80386-based machine";;
  i486 ) echo "80486-based machine";;
  i586 ) echo "Pentium-based machine";;
  i686 ) echo "Pentium2+-based machine";;
  *    ) echo "Other type of machine";;
esac

exit 0
echo; echo "Hit a key, then hit return."
read Keypress

case "$Keypress" in
  [[:lower:]]   ) echo "Lowercase letter";;
  [[:upper:]]   ) echo "Uppercase letter";;
  [0-9]         ) echo "Digit";;
  *             ) echo "Punctuation, whitespace, or other";;
esac      #  Allows ranges of characters in [square brackets],
          #+ or POSIX ranges in [[double square brackets.