oliverlloyd/jmeter-ec2

Error on floating point arithmetic

avmohan opened this issue · 5 comments

./jmeter-ec2.sh: line 81: 0 + 3.6: syntax error: invalid arithmetic operator (error token is ".6")
Bash doesn't understand floating pt arithmetic.

I've received the same issue as well.

Line 81 points to echo $[$1 + $2] in the jmeter-ec2.sh file

I've temporarily replaced the lines that use 'add' to an older release. (example)

#count_overallhosts=$(add $count_overallhosts $count_total)

to

count_overallhosts=$(echo "$count_overallhosts+$count_total" | bc)

This bypasses the error report in console when executing.

Yeah.. I had changed the add function itself to use bc

This sound like a regression bug. I knew there was a reason I'd used bc... @benztest or @abhi92, Do you want to put that fix into a pull request and I'll merge it in. I think it would be good to keep the add() function though, for neatness.

@oliverlloyd sure, I'll give it ago.

Closed by PR #84