Just a site to share some of my memories.
11 October 2010
Bash unfortunately does not include a built-in function to test if a variable is an integer. There is however a simple pattern matching hack that you can use to test this on your own:
[[ $number =~ ^[0-9]+$ ]] && echo "match found : integer"
[[ $number =~ ^[+-]?[0-9]+$ ]] && echo "match found : (signed) integer"