The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
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 05-12-2008
amatuer_lee_3 amatuer_lee_3 is offline
Registered User
  
 

Join Date: May 2008
Posts: 53
while loop problems

I have a problem validating my script. The start of my script begins like this:

Quote:
while yesno=[Yy][Ee][Ss]

do
then after this i have all of my script and functions.

at the end i close the loop with this code:

Quote:
echo "Would you like to run the HITS search again?: "
read yesno

done
What i want to know is, how do i make the loop so that only Yes or no can be an answer?

and if the wrong thing is entered how do i get an error message to appear?