Imported from ../bash-2.04.tar.gz.
This commit is contained in:
parent
b72432fdcc
commit
bb70624e96
387 changed files with 28522 additions and 9334 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue