Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

until loop that prompts for a valid response

Status
Not open for further replies.

vergeb

MIS
Sep 22, 2003
8
US
I am trying to write an until loop that will only exit when a valid response (Y/N) is given. for example:
until
[[ $response == "Y" ]] or [[ $response == "N" ]]
do
read response?"Enter response "
if
then
else
fi
done

Any ideas on how to make this work?
 
#!/bin/ksh

until [[ $response == "Y" ]] || [[ $response == "N" ]]
do
echo "Enter response "
read response
echo $respone
done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top