2023-10-31 17:31:23 +01:00
|
|
|
function g_num_is_higher {
|
|
|
|
|
|
|
|
local f_num=$1
|
|
|
|
local f_checkhigher=$2
|
|
|
|
|
|
|
|
# Check for integer (can be done with bash itself)
|
|
|
|
if [[ ${f_num} =~ ^[0-9]+$ ]] && [[ ${f_checkhigher} =~ ^[0-9]+$ ]]
|
|
|
|
then
|
|
|
|
# Check which is the low (from) and the high (to) number
|
|
|
|
if [ "${f_num}" -gt "${f_checkhigher}" ]
|
|
|
|
then
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Check for valid number
|
|
|
|
g_num_valid_number "$f_num" "$f_checkhigher" || return 1
|
|
|
|
|
2023-11-03 14:57:05 +01:00
|
|
|
if [ $(g_calc "${f_num} > ${f_checkhigher}") -ne 0 ]
|
2023-10-31 17:31:23 +01:00
|
|
|
then
|
|
|
|
return 0
|
|
|
|
else
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
}
|