I found below script to check whether the variable is a digit in ksh.
############################
#!/bin/ksh
REPLY="3f"
if [[ `expr "${REPLY}" : '\([1-9][[:digit:]]*\)'` != ${REPLY} && "${REPLY}" != "0" ]]
then
print "is digit\n"
else
print "not digit\n"
fi
############################
Although it works fine, but i just can not understand the first part of if condition. it looks like a general expression though, but what command it is called? and how to explain the [[:digit:]]?
Please share your comments with me. Thanks in advance