case statement

hi all
i'm writing a script and in it i need to prompt the user if the entered value is correct or not ,i wrote the following and its not working ,its executing the script even if i enter Y/N

pls any help is appreciated

echo "\nAre you sure you entered the right Destination Environment? y[n] : \c \n"
read ans
case ${ans} in
y/Y)
*);;
esac

the format is wrong

case "$ans" in
y | Y )
      echo yes
      ;;
* )
      echo default
      ;;
esac

thnks for the reply ,but like i said even if i enter N ,the script is still running

I don't know what you mean by "the script is still running".

the "*" clause will match "N".

Sir according to the script if the user enters either N/n then the script must ask him to enter a valid number,instead here its gng to the nxt step and executuing it

thnks

Not according to the script you posted....

echo "\nAre you sure you entered the right Destination Environment? y[n] : \c \n"
read ans
case ${ans} in
y/Y)
*);;
esac 

Nothing about case "N", nothing about "valid number". Your case statement is just plain wrong.