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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 12-04-2005
grahamb grahamb is offline
Junior Member
 

Join Date: Dec 2005
Location: Windsor, Ont Canada
Posts: 13
Testing a range of values

Hi again djt !!

Try this one, this idea addresses the RH-side of the equation, namely: ranges of values:
Code:
read character
case $character in
            # Check for letters
    [a-z] | [A-Z] ) echo "Alpha range i[a-z]: You typed the letter $character"
            ;;
            # Check for digits
    [0-9] )     echo "Numeric range: 0-9: You typed the digit $character"
            ;;
            # Check for anything else
    * )         echo "You did not type a letter or a digit"
esac
Try this link for further explanations: http://linuxcommand.org/wss0120.php

Again, I hope this is usefull!
Rergards
GrahamB
Reply With Quote