Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

Bash test if variable is a number

[[ $1 == ?(-)+([0-9]) ]] && echo "$1 is an integer"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Bash #test #variable #number
ADD COMMENT
Topic
Name
2+8 =