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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trap smart alecs

Status
Not open for further replies.

gawdknows

Technical User
Mar 4, 2003
95
IN
We run system on a Unix box, through a Telnet session. We have certain processes
that run thw whole day. when these processes run, there are SOME &quot;clever&quot; system users that press <ctrl-C> in these terminal windows. This causes anything running on the
telnet session to exit, and puts the promt in unix.

Is there a way to trap ctrl-c by say ....writing to a file ?
do you have to set up something on unix to trap this command ?
 
Turn off interrupt key with....

stty intr &quot;&quot;

...but perhaps you could use exec command ? Users that press <ctrl-C> would be logged-out, eg....

exec all_day_cmd

 
In addition to the stty intr '', I also added stty quit ''



Blue [dragon]

If I wasn't Blue, I would just be a Dragon...
 
Presuming each login name has a .profile that runs a script, just put exec in front of the script name.
 
Thx . all
I've the basics now, the interrupt + trap works just fine.

Thx .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top