• Uncategorized

About linux : Can-a-bash-script-can-decline-the-stop-execution-order-from-terminal-duplicate

Question Detail

Actually I am trying to create a password 🔑 protection for my terminal. Means when we start the terminal it will ask for password first.

But the problem is that if I press CTRL + z then the password script will stop.

How to fix this.

Question Answer

use trap command:

trap 'printf "you can't do this"' SIGTSTP 

Control+C sends SIGINT which will interrupt the application

Control+Z sends SIGTSTP

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.