One method you can use is by using pattern matching.
1. Variable is defined that may or may not contain a number and/or characters
2. Scan variable, removing anything that is not a number
3. Compare old and new variables.
3a. If they match, the original is a number.
3b. If they do not match, the original is not a number.
Here is some test code that should help you out.
for num in 192391 gmkrelgg3 2t4 32 gfsgfsd t43g4 4224 gr3gr3 42
echo -n "num,num2: $num,$num2: "
if [ "$num" == "$num2" ]; then
echo "is a number"
echo "is not a number"
and the results:
num,num2: 192391,192391: is a number
num,num2: gmkrelgg3,3: is not a number
num,num2: 2t4,24: is not a number
num,num2: 32,32: is a number
num,num2: gfsgfsd,: is not a number
num,num2: t43g4,434: is not a number
num,num2: 4224,4224: is a number
num,num2: gr3gr3,33: is not a number
num,num2: 42,42: is a number
Of course, this won't work with all numbers (for example, numbers that contain + or - and .'s) but it's prolly good enough for what you need it for. (=