Arithmetic Operators Example 1

 [prabhucloudxlab@cxln4 ~]$ cat>2sh.sh
#Script
#! bin/bash
echo "ssc percentage is:"
read ssc
echo "intermediate percentage is:"
read intermediate

if [ $ssc -ge 70 -a $intermediate -ge 60 ] #------------->> -a means AND operator, both conditions should be true
#if [ $ssc -ge 70 ] && [ $intermediate -ge 60 ]
then
echo "eligable candidate"
else
echo "not elagible"
fi

echo "8th percentage is:"
read eight
echo "9th percentage is:"
read nine

if [ $eight -ge 70 -o $nine -ge 60 ]
#if [ $ssc -ge 70] || [$intermediate -ge 60 ] #------------->> -o means AND operator, atleast one condition should be true enough
then
echo "eligable candidate"
else
echo "not elagible"
fi



Output

[prabhucloudxlab@cxln4 ~]$ sh 2sh.sh
ssc percentage is:
45
intermediate percentage is:
70
not elagible
8th percentage is:
45
9th percentage is:
70
eligable candidate