Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to prevent a user from cancelling a script

Status
Not open for further replies.

pujas

Programmer
Feb 2, 2005
22
0
0
US
Hi,

I wanted to know the way of preventing anyone including myself to do a ctrl-c on the script running.

Basically even if i do a ctrl-c the script should not stop running.

Thanks
 
man trap

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Hi,

could you please be more elaborate about how to use the trap cmd for this case.

Thanks
 
trap "" 1 2 3 15

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
i'sm relatively new to unix so could you tell me what "" and 1 2 3 15 means.

Where does ctrlc and my unix shell pgm name come in this cmd.

thanks
 
In your shell man page, pay attention to the trap builtin.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
The "" 1 2 3 15 are trap signals that unix interperets. Without looking in a book to tell you what each signal means. Basically it has to do with not allowing CTRL+C CTRL+~ etc... To disable them use the command trap 1 2 3 15 with out the "". I tend to use these commands in .profiles as well to stop uses breaking out to a shell prompt.


( &quot;To become Wise, first you must ask Questions&quot;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top