Try,
#!/bin/bash pause () { REPLY=Y while [ "$REPLY" == "Y" ] || [ "$REPLY" != "y" ] do echo -e "\t\tPress 'y' to continue\t\t\tPress 'n' to quit" read -n1 -s case "$REPLY" in "n") exit ;; "N") echo "case sensitive!!" ;; "y") clear ;; "Y") echo "case sensitive!!" ;; * ) echo "Invalid"$REPLY is Invalid Option" ;; esac done } pause echo "Hi"