mirror of
https://github.com/ovh/debian-cis.git
synced 2025-06-21 18:23:42 +02:00
Remove bc dependency
Co-authored-by: Jeremy Denoun <jeremy.denoun@iguanesolutions.com>
This commit is contained in:
@ -112,3 +112,20 @@ sudo_wrapper() {
|
||||
crit "Not allowed to \"sudo -n $*\" "
|
||||
fi
|
||||
}
|
||||
|
||||
#
|
||||
# Math functions
|
||||
#
|
||||
|
||||
function div() {
|
||||
local _d=${3:-2}
|
||||
local _n=0000000000
|
||||
_n=${_n:0:$_d}
|
||||
if (($2 == 0)); then
|
||||
echo "N.A"
|
||||
return
|
||||
fi
|
||||
local _r=$(($1$_n / $2))
|
||||
_r=${_r:0:-$_d}.${_r: -$_d}
|
||||
echo $_r
|
||||
}
|
||||
|
Reference in New Issue
Block a user