Hi All,
I currently have a shell script which is pulling multiple counters from various sources. Due to the counters being cumulative counters I've got some code to work out the delta from the last reading and current which is working fine.
The problem i have now is being able to work out the success rate as a percentage.
Normally I would just take success and divide by attempts then multiply this by 100 which would give my success rate at a percentage (i'd like it to 2 decimal places).
Note that if the decimal point had been omitted in the calculation marked above in red, ksh would have used integer arithmetic instead of floating point.
If you are using a DEFAULT CygWin(64) install then you only have one choice for floating point maths, awk , all other commands and languages do not exist...
The current CygWin(64) shell is bash Version 4.3.4.
Example:-