Test for Numeric
Sources: stackoverflow 806906 answer by F. Hauri "Some performance and compatibility hints"
isuint_Regx() { [[ $1 =~ ^[0-9]+$ ]] ;}
isint_Regx() { [[ $1 =~ ^[+-]?[0-9]+$ ]] ;}
isnum_Regx() { [[ $1 =~ ^[+-]?([0-9]+([.][0-9]*)?|\.[0-9]+)$ ]] ;}
Note that a more efficient way is using case, viz:
isuint_Case() { case $1 in ''|*[!0-9]*) return 1;;esac;}
isint_Case() { case ${1#[-+]} in ''|*[!0-9]*) return 1;;esac;}
isnum_Case() { case ${1#[-+]} in ''|.|*[!0-9.]*|*.*.*) return 1;; esac ;}