The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 08-21-2007
namishtiwari namishtiwari is offline Forum Advisor  
Registered User
  
 

Join Date: Aug 2007
Location: Bangalore
Posts: 377
Lightbulb Only Digits as input

Hi All,
I am new to shell script.
I wrote a very small script that takes only digits as input-
but there is some problem in that.can you help me in debugging that.

#!/bin/ksh
echo "Digits as input"
read number
digit='eval [0-9][0-9][0-9]'
if [[ number -eq $digit ]]
then
echo "Entered number is a digit"
else
echo "0"
fi

Please modify this one or without AWK give me some inputs.

Thanks,
Namish