0

Here is my code, its pretty self-explanatory:

if [ 0.02779 -lt 1.972 ]
   then 
        echo "0"
fi

Thanks for your time

mklement0
  • 382,024
  • 64
  • 607
  • 775
John Smith
  • 679
  • 1
  • 9
  • 17
  • 1
    Bash doesn't support floating-point math. – Charles Duffy Feb 25 '16 at 20:55
  • Bash only supports integer arithmetic. Floating point is not possible. You could use string comparison, of course, but that would give a wrong answer for values > 9, and probably in other cases. – jpaugh Feb 25 '16 at 20:55
  • duplicate of http://stackoverflow.com/q/8654051/1292652 – Yatharth Agarwal Feb 25 '16 at 20:57
  • 2
    ...on a different topic, `[ ... ]` is *not* part of `if` syntax. You could run it as its own command and use `$?` to check the result, for instance. `if` allows *any* command to be used (and thus checked), not only `[`. – Charles Duffy Feb 25 '16 at 20:57

0 Answers0