-
Notifications
You must be signed in to change notification settings - Fork 281
Open
Description
I've removed the bc and command dependencies and changed the average calculation to pure shell scripting in the hopes of making the script a bit more compatible with limited systems.
Instead of
command -v (...)
(...)
avg=`bc -l <<< "scale=2; $ftime/$totaldomains"`
I changed to
which (...)
(...)
avg=$((100 * ftime / totaldomains))
avg_decimal=$((avg / 100))
avg_remainder=$((avg % 100))
printf "%d.%02d\n" $avg_decimal $avg_remainder
It seems the result is correct.
Why did you use BC after all?
Metadata
Metadata
Assignees
Labels
No labels