I have value 0.000000 written in a file. I open the file and assign it to a variable.
But when i compare it’s value like if [ "$var" -eq "0.000000" ] it doesn’t evaluate to true.
What could be the reason?
Moreover, if the file has just 0, and if i compare it’s value [ "$var" -eq "0" ] it evaluates as expected to true.
As Fredrik (+1 for him) said, bash does not support floating point. If you must, use string comparison: