variable rename

This commit is contained in:
olli 2023-12-04 17:05:54 +01:00
parent 2942adc0c8
commit af25e84b7d

View File

@ -1,13 +1,13 @@
function g_num_is_lower_equal {
local f_num=$1
local f_checkhigher=$2
local f_checklower=$2
# Check for integer (can be done with bash itself)
if [[ ${f_num} =~ ^[0-9]+$ ]] && [[ ${f_checkhigher} =~ ^[0-9]+$ ]]
if [[ ${f_num} =~ ^[0-9]+$ ]] && [[ ${f_checklower} =~ ^[0-9]+$ ]]
then
# Check which is the low (from) and the high (to) number
if [ "${f_num}" -le "${f_checkhigher}" ]
if [ "${f_num}" -le "${f_checklower}" ]
then
return 0
else
@ -16,9 +16,9 @@ function g_num_is_lower_equal {
fi
# Check for valid number
g_num_valid_number "$f_num" "$f_checkhigher" || return 1
g_num_valid_number "$f_num" "$f_checklower" || return 1
g_calc "${f_num} <= ${f_checkhigher}"
g_calc "${f_num} <= ${f_checklower}"
if [ ${g_calc_result} -ne 0 ]
then
return 0
@ -31,13 +31,13 @@ function g_num_is_lower_equal {
function g_num_is_lower {
local f_num=$1
local f_checkhigher=$2
local f_checklower=$2
# Check for integer (can be done with bash itself)
if [[ ${f_num} =~ ^[0-9]+$ ]] && [[ ${f_checkhigher} =~ ^[0-9]+$ ]]
if [[ ${f_num} =~ ^[0-9]+$ ]] && [[ ${f_checklower} =~ ^[0-9]+$ ]]
then
# Check which is the low (from) and the high (to) number
if [ "${f_num}" -lt "${f_checkhigher}" ]
if [ "${f_num}" -lt "${f_checklower}" ]
then
return 0
else
@ -46,9 +46,9 @@ function g_num_is_lower {
fi
# Check for valid number
g_num_valid_number "$f_num" "$f_checkhigher" || return 1
g_num_valid_number "$f_num" "$f_checklower" || return 1
g_calc "${f_num} < ${f_checkhigher}"
g_calc "${f_num} < ${f_checklower}"
if [ ${g_calc_result} -ne 0 ]
then
return 0