Thursday, January 22, 2009

Float/Real Number Comparison

if [ $( echo "5.5 > 10.5" | bc ) -eq 1 ]; then
echo 5.5 is greater than 10.5.
else
echo 5.5 is NOT greater than 10.5.
fi
=> 5.5 is NOT greater than 10.5.

No comments: