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?
I've removed the
bcandcommanddependencies 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
I changed to
It seems the result is correct.
Why did you use BC after all?