I have the following code:
TEMP1=$(awk '$12 == "beacon_server" {print}' < numbers2.log | awk -v var="$i" '{total += $var} EN D {print total/NR}')
Almost the same for the other TEMP-variables.
Now i want to calculate the following and save it in a new variable RESULT:
RESULT=$(expr 100 - $TEMP1 - $TEMP2 - $TEMP3 - $TEMP4)
The error message is telling me that there is a non-integer argument --> expr: non-integer argument
How can I resolve this error?
TEMP
variables when you get that error? One or more of them isn't an integer. As an aside, preferRESULT=$(( 100 - $TEMP1 - $TEMP2 - $TEMP3 - $TEMP4))
to using the external commandexpr
.arithmetic expression: expecting EOF: " 100 - 1 - 2.23333 - 0.333333 - 0"