The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



Thread: Simple Script
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 05-11-2008
ragavhere ragavhere is offline
Registered User
 

Join Date: Apr 2008
Location: Chennai,India
Posts: 69
Hi try this code in bash,

read M
read R
read T
A=`expr $M + $R + $T`
B=2000
if [ "$A" -gt "$B" ]; then
echo "A is greater than 2000"
elif [ "$A -lt "$B ];
echo "A is less than 2000"
elif [ "$A" = "$B" ]; then
eho "A is equal to 2000"
fi
Reply With Quote