variable rename
This commit is contained in:
parent
2942adc0c8
commit
af25e84b7d
@ -1,13 +1,13 @@
|
|||||||
function g_num_is_lower_equal {
|
function g_num_is_lower_equal {
|
||||||
|
|
||||||
local f_num=$1
|
local f_num=$1
|
||||||
local f_checkhigher=$2
|
local f_checklower=$2
|
||||||
|
|
||||||
# Check for integer (can be done with bash itself)
|
# 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
|
then
|
||||||
# Check which is the low (from) and the high (to) number
|
# Check which is the low (from) and the high (to) number
|
||||||
if [ "${f_num}" -le "${f_checkhigher}" ]
|
if [ "${f_num}" -le "${f_checklower}" ]
|
||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
@ -16,9 +16,9 @@ function g_num_is_lower_equal {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for valid number
|
# 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 ]
|
if [ ${g_calc_result} -ne 0 ]
|
||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
@ -31,13 +31,13 @@ function g_num_is_lower_equal {
|
|||||||
function g_num_is_lower {
|
function g_num_is_lower {
|
||||||
|
|
||||||
local f_num=$1
|
local f_num=$1
|
||||||
local f_checkhigher=$2
|
local f_checklower=$2
|
||||||
|
|
||||||
# Check for integer (can be done with bash itself)
|
# 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
|
then
|
||||||
# Check which is the low (from) and the high (to) number
|
# Check which is the low (from) and the high (to) number
|
||||||
if [ "${f_num}" -lt "${f_checkhigher}" ]
|
if [ "${f_num}" -lt "${f_checklower}" ]
|
||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
@ -46,9 +46,9 @@ function g_num_is_lower {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check for valid number
|
# 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 ]
|
if [ ${g_calc_result} -ne 0 ]
|
||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user