Link Search Menu Expand Document

Else condition

#! /bin/bash 

read -p "How old are you? " age 

if [ $age -gt 100 ]; then 
    echo "You are old!"
else 
    echo "you are still very young!"
fi

echo "bye"

echo " * ----------------- *  "

read -p "Type a integer number btw 1 and 4: " num

if [ $num == "1" ]; then 
    echo "type 1"
elif [ $num == "2" ]; then 
    echo "type 2"
elif [ $num == "3" ]; then
    echo "type 3" 
elif [ $num == "4" ]; then
    echo "type 4"
else 
    echo "you entered a number outside of 1 and 4"
fi 
echo "done here. "