For unsigned integers I use:
read -r scale [ -z "${scale//[0-9]/}" ] && [ -n "$scale" ] || echo "Sorry integers only" Tests:
$ ./test.sh 7 $ ./test.sh 777 $ ./test.sh a Sorry integers only $ ./test.sh "" Sorry integers only $ ./test.sh Sorry integers only