Asking for user confirmation in a
bash script is easy!
Yes/No prompt with default no
If the default is
No for an invalid character or space, simply check if the prompt answer is
read, user input can be limited to a single character using the
-n 1 parameter.
Similarly, a case statement may be used: