Fixed debug trapError show warnings in IsNumeric functions when not numeric

This commit is contained in:
deajan 2016-11-13 15:49:40 +01:00
parent 91bd655fa1
commit 16a717a8bb
1 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#### MINIMAL-FUNCTION-SET BEGIN #### #### MINIMAL-FUNCTION-SET BEGIN ####
## FUNC_BUILD=2016111201 ## FUNC_BUILD=2016111301
## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
## To use in a program, define the following variables: ## To use in a program, define the following variables:
@ -801,10 +801,10 @@ function IsNumericExpand {
local re="^-?[0-9]+([.][0-9]+)?$" local re="^-?[0-9]+([.][0-9]+)?$"
if [[ $value =~ $re ]]; then if [[ $value =~ ^-?[0-9]+([.][0-9]+)?$ ]]; then
echo 1 && return 1 echo 1
else else
echo 0 && return 0 echo 0
fi fi
} }
@ -813,9 +813,9 @@ function IsNumeric {
local value="${1}" local value="${1}"
if [[ $value =~ ^[0-9]+([.][0-9]+)?$ ]]; then if [[ $value =~ ^[0-9]+([.][0-9]+)?$ ]]; then
echo 1 && return 1 echo 1
else else
echo 0 && return 0 echo 0
fi fi
} }
@ -823,9 +823,9 @@ function IsInteger {
local value="${1}" local value="${1}"
if [[ $value =~ ^[0-9]+$ ]]; then if [[ $value =~ ^[0-9]+$ ]]; then
echo 1 && return 1 echo 1
else else
echo 0 && return 0 echo 0
fi fi
} }