The read command can be a headache when you are porting your scripts from a shell to another.
Let's see the way it works with bash (the default shell for macOS before Catalina):
read -p "Do you wish to continue? (Y/n)"
[[ $REPLY == "y" ]] && echo "You must use Capital Y if you wish to continue"
[[ $REPLY != "Y" ]] && exit