I wrote the code below:for j in `cat output_10.txt`dodri=`echo $j |cut -d':' -f1` nu=`echo $j |cut -d':' -f2`tot=`echo $j |cut -d':' -f3`fre=`echo $j |cut -d':' -f4`if [ $fre > 2 ]                then                echo <td align=Center bgcolor=#81F781> $fre </td> >>mailbody.html                else                echo <td align=Center bgcolor=#B40404> $fre </td> >>mailbody.htmlfidone where the value of fre is being read from output_10.txt file and is a something like 9.8.The issue is that the else condition is not working even if the value of the $fre is less than 2 . I want if the value of $fre is less than 2, the else condition work and it should display the color red in my HTML page.As of now green color is displayed in my HTML page for both the cases.
Comparing an string by value of a floating number to a number
bash;shell script;test;floating point