gaboshlib/g_num_valid_number.sh hinzugefügt
This commit is contained in:
parent
efad917366
commit
233b737809
11
gaboshlib/g_num_valid_number.sh
Normal file
11
gaboshlib/g_num_valid_number.sh
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
function g_num_valid_number {
|
||||||
|
local f_num
|
||||||
|
for f_num in $@
|
||||||
|
do
|
||||||
|
if ! [[ ${f_num} =~ ^(-)?(\.)?[0-9]+(\.[0-9]+)?$ ]]
|
||||||
|
then
|
||||||
|
g_echo "\"${f_num}\": Not a valid number"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user