How can I prevent a user from using Ctrl + C to stop a script?
I load a script in file .bash_profile, and this script will ask for the right password whenever a user opens a terminal window. If the user enters a wrong code, the script will run exit to stop the current terminal.
if [ $code = "980425" ]; then
echo hello
else
exit
fi
But I realize that the user can always use Ctrl + C to stop the script and enter the terminal. How can I avoid that?