mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-09 05:00:49 +02:00
Imported from ../bash-2.04.tar.gz.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
# BASH NOTE: make sure you have executed `shopt -s extglob' before
|
||||
# trying to use this function, or it will not work
|
||||
|
||||
function isnum # string
|
||||
isnum() # string
|
||||
{
|
||||
case $1 in
|
||||
?([-+])+([0-9])?(.)*([0-9])?([Ee]?([-+])+([0-9])) )
|
||||
@@ -21,3 +21,32 @@ function isnum # string
|
||||
*) return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
isnum2() # string
|
||||
{
|
||||
case $1 in
|
||||
?([-+])+([[:digit:]])?(.)*([[:digit:]])?([Ee]?([-+])+([[:digit:]])) )
|
||||
return 0;;
|
||||
?([-+])*([[:digit:]])?(.)+([[:digit:]])?([Ee]?([-+])+([[:digit:]])) )
|
||||
return 0;;
|
||||
*) return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
isint() # string
|
||||
{
|
||||
case $1 in
|
||||
?([-+])+([0-9]) )
|
||||
return 0;;
|
||||
*) return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
isint2() # string
|
||||
{
|
||||
case $1 in
|
||||
?([-+])+([[:digit:]]) )
|
||||
return 0;;
|
||||
*) return 1;;
|
||||
esac
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user