i need to make sure that a command line paramter is with in a certin set of numbers and i dont know how todo it with out checking individual numbers.
if test $1 -eq (need something here)
then
echo hi
fi
like if i put individual numbers in there it works fine but how do i do a range
if [ `echo $1 | grep -c -i [a-z\ \*\\\//\$?]` -eq 1 ];then
echo "Is not number"
else
echo "Is number"
fi
If there is a 0 in the number it doesnt work. and i need to include $2 in the check
aigles
4
Another tho check for a number
if expr "$1" : '[[:digit:]]\{1,\}$' >/dev/null
then
echo "Is number"
else
echo "Is not number"
fi
whith KSH
if [[ "$1" = +([0-9]) ]]
then
. . . . .
Jean-Pierre.