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 04-26-2005
noobian noobian is offline
Registered User
  
 

Join Date: Apr 2005
Posts: 1
defining a variable as a number or character?

I am writing a script that needs to accept numbers into a variable by prompting and using the code
read num
case $num in
000)
break
;;
*)

I am fairly new to unix and am loving the versatility of the language but need a little shove in the right direction. I know how to define variables in C++, but how do you make sure that a variable is a number? And if a character string is entered instead of a number is there any way that i could send an error message and start the loop again.
thank you in advance