#!/bin/ksh echo "Digits as input" read number test=`echo "$number" | egrep "^[0-9]+$"` if [ "$test" ] then echo "Entered number is a digit" else echo "0" fi