This is an interesting scenario and I'm relatively new in writing shell scripts. I have a case where I want the user to enter a password at a prompt. That works fine.
The PROBLEM is if the user should Ctrl-C exit at that point. Because the password prompt turns off text entry to the terminal, if the users exits there, text entry to the terminal is still turned off, leaving a frustrated user.
In PHP programming we have a register_shutdown_function() which will be called on exit, regardless of where or when that happens in the program. Is there an equivalent in Bash for the Ctrl-C command?
read -sor are you turning echo off/on yourself?{}. It's also better there because everyone can quickly find it as part of your question