#!/ash/sh
val=$1
if [ ! $(echo "$val" | grep -E "^[0-9]+$") ]; then
echo $val is not a valid integer
else
echo $val is an integer
exit 1
fi
Syntax: ./check.sh 45
Thursday, January 15, 2009
Subscribe to:
Post Comments (Atom)
2 comments:
Excellent one!
Glamorous work...keep it up
Hi Syed,
Thanks for the comments. I will try to upload most of my other handy codes as well.
Post a Comment