Shell Script to Find Greatest of Three Numbers



Shell Script to Find Greatest of Three Numbers | ninjasquad

In this tutorial, You’ll learn shell script to find greatest of three numbers. In this shell programming, based on basic control structure like if-else. 

echo "Enter Num1"
read num1
echo "Enter Num2"
read num2
echo "Enter Num3"
read num3
if [ $num1 -gt $num2 ] && [ $num1 -gt $num3 ]
then
echo $num1
elif [ $num2 -gt $num1 ] && [ $num2 -gt $num3 ]
then
echo $num2
else
echo $num3
fi

Above You’ll learn shell script to find greatest of three numbers. I hope you enjoy this.

Happy Coding 😊



Source: Internet

Leave a Comment

We are offering free coding tuts

X