DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR SHELL
check if variable is a number in bash
re='^[0-9]+$' if ! [[ $yournumber =~ $re ]] ; then echo "error: Not a number" >&2; exit 1 fi
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#check
#variable
#number
#bash
ADD COMMENT
Topic
COMMENT
Name
6+5 =
Submit