Evaluating Decimal values

How can I evaluate a decimal value in an if statement?

echo "Enter limit:"
read limit (enter a decmal value, ie: 2.5)
decimallimit=`echo $limit+0|bc|quit`
echo $decimallimit
if [ $decimallimit -lt 10 ]
then
echo $decimallimit
else
echo "failed"
fi

Try:

echo Enter limit: ;read limit ; test ${#limit} -eq 3 && echo OK || echo failed

Thanks for the help. I will incorporate this into my script.

The last suggestion did not work. I need to actually take into account the value entered in decimal form and verify that it is less that 10. I know that I have to incorporate the bc calculator into this; but cannot figure out how to implement this. Any suggestions?

How can I evaluate a decimal value in an if statement?

echo "Enter limit:"
read limit (enter a decmal value, ie: 2.5)
decimallimit=`echo $limit+0|bc|quit`
echo $decimallimit
if [ $decimallimit -lt 10 ]
then
echo $decimallimit
else
echo "failed"
fi

here's a starter:

#!/bin/ksh

a=1.72
b=1.71

if [ "$(echo "if (${a} > ${b}) 1" | bc)" -eq 1 ] ; then
   echo ">"
else
   echo "<"
fi;