How to confirm script continuation with yes/no in Bash on Linux command line.

I made the following script clearer and easier to use.
How do I prompt a user for confirmation in bash script? - Stack Overflow
ok(){
: <<< '
yes or no prompt
e.g. printf "The file alredy exist here. Overwrite it? " ; ok && echo y || echo n
'
read -n 1 -r ; [[ $REPLY =~ ^[Yy]$ ]] && return 0 || return 1
}
Usage example
printf "The file alredy exist here. Overwrite it? " ; ok && echo y || echo n