onintr, trap, etc.

Mike O'Connor mjo at irie.ais.org
Tue Apr 2 06:14:15 AEST 1991


I am trying to write a script that will only run when I receive a
hangup signal (i.e. when I am forcibly disconnected).  

How do I determine that I am indeed HUPped?  So far, I have:

#!/bin/sh
#deathtrap -- will run these commands if I get HUPped
trap hangupscript 0

When I run this interactively with:

% nohup deathtrap &

The script wants to run immediately.

What am I doing wrong?  What I really want to do is have my .logout
run from tcsh in the event that I am lorcibly logged out.  Currently,
it only runs if I type "logout".  

HELP!





____
Mike O'Connor <mjo at ais.org>



More information about the Comp.unix.questions mailing list