Else if statement with examples | Shell scripting

#!/bin/bash

read -p "Enter numeric value: " EnteredValue

if [ $EnteredValue -gt  90]
then
    echo "Entered Value is greater than 90"
fi

=======================================
#!/bin/bash

read -p "Enter numeric value: " EnteredValue

if [ $EnteredValue -gt 90 ]
then
    echo "Entered Value is greater than 90"
else
    echo "Entered Value is less than 90"
fi
exit

=========================================
#!/bin/bash

read -p "Enter numeric value: " EnteredValue

if [ $EnteredValue -ge 90 ]
then
    echo "Entered Value is greater than 90"

elif [ $EnteredValue -ge 70 ]
then
    echo "Entered Value is greater than 70"

else 
    echo "Enterted Value is less 70"
fi

Comments

Popular posts from this blog

Awk command with simple examples

Learn Linux in Telugu | Linux complete Free Course in Telugu by 7Hills

rsync Command Examples | rsync Command In Telugu