Friday 4 September 2015

Shell Script - Which value is greater than

#!/bin/bash

##Purpose: Comparing the values which one is greater than.

##AUTHOR: Ankam Ravi Kumar

##4th, SEP, 2015

 

echo "enter the a vlaue $a"

read a

echo "enter the b value $b"

read b

if test "$a" -gt "$b" ; then

        echo "$a is greater than $b"

else

echo "$b is greater than $a"

fi

 


Explanation: which value is grater than, in above collecting two values and comparing both the values using ‘–ge’ which value is greater then. –ge = Greater than

No comments:

Post a Comment