Current Path : /compat/linux/usr/share/doc/bash-3.2/functions/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //compat/linux/usr/share/doc/bash-3.2/functions/isnum2 |
isnum2() { case "$1" in '[-+]' | '') return 1;; # empty or bare `-' or `+' [-+]*[!0-9]*) return 1;; # non-digit with leading sign [-+]*) return 0;; # OK *[!0-9]*) return 1;; # non-digit *) return 0;; # OK esac } # this one handles floating point isnum3() { case "$1" in '') return 1;; # empty *[!0-9.+-]*) return 1;; # non-digit, +, -, or . *?[-+]*) return 1;; # sign as second or later char *.*.*) return 1;; # multiple decimal points *) return 0;; # OK esac }