I am passing an argument to a file and i wanna check whether the argument is a number or string ?
how can i do this?
[[ -z $( echo $x | grep "^[0-9]*$" ) ]] || echo "number"
#/bin/ksh
a=$1
b=`echo $a| tr -dc '[:digit:]' `
if [[ "$b" = "$a" ]] ; then
echo "numbers only"
else
echo "not numbers only"
fi
thanks it works