방법 1.
http://stackoverflow.com/questions/806906/how-do-i-test-if-a-variable-is-a-number-in-bash
re='^[0-9]+$'
if ! [[ $yournumber =~ $re ]] ; then
echo "error: Not a number" >&2; exit 1
fi
방법 2.
http://grzechu.blogspot.kr/2006/06/bash-scripting-checking-if-variable-is.html
if [ $VARIABLE -eq $VARIABLE 2> /dev/null ]; then
echo $VARIABLE is a number
else
echo $VARIABLE isn't a number
fi