Find the answer to your Linux question:
Results 1 to 3 of 3
I am trying to write a script that uses whiptail as a menu dialog. The script runs at user login. I would like to prevent the user from pressing the ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    15

    an easy way to disable escape key in bash?

    I am trying to write a script that uses whiptail as a menu dialog. The script runs at user login. I would like to prevent the user from pressing the esc key and breaking out of the script. Is there an easy way to do this?

    I have tried putting the exit command at the end of my script but that seems to do nothing.

    Thanks in advance.

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    You can use the trap command to disable CTR-C:

    Code:
    trap "Ctrl-C is not allowed.." SIGINT
    Regards

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    15
    actually whiptail already prevents the CTRL-C from breakin to the shell.

    specifically i need to trap the esc key. is this possible?

    thanks for your time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...