I am trying to subtract two numbers by running the following bash script:
cur_length=`cat length.txt`
cur_pos=`cat pos.txt`
diff=`$(expr $cur_length - $cur_pos)`
echo "$diff"
But the output says that expr has some problem:
expr: non-integer argument
+ diff=
+ echo ''
I searched for "expr: non-integer argument" on the net, but nothing included decimal numbers. How can I subtract such numbers? 235.68 - 145.9
Thanks in advance.
source
share