Hi all,
I have a issue... Is it possible to compare integer value with decimal value.
If it is not possible,then how can i compare 2 decimal values in born shell.thanks!
Try using bc.
x=`echo 10 + 11 |bc`
sets x equal to 21
x=`echo 10.5 - 1.3 |bc`
sets x equal to 9.2
One way...
a=1.2
b=1.1
if awk 'BEGIN{if(0+'$a'>'$b'+0)exit 0;exit 1}'
then
echo true
else
echo false
fi
Also check "Similar Threads" at the bottom of this page.
Thanks Jgt & Ygor for replying my query.I will try and see.