Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!topaz!gaynor From: gaynor@topaz.RUTGERS.EDU (Silver) Newsgroups: net.unix Subject: a little help with some csh source Message-ID: <5273@topaz.RUTGERS.EDU> Date: Thu, 3-Jul-86 11:59:29 EDT Article-I.D.: topaz.5273 Posted: Thu Jul 3 11:59:29 1986 Date-Received: Fri, 4-Jul-86 06:45:13 EDT Organization: Rutgers Univ., New Brunswick, N.J. Lines: 52 Keywords: onintr, interrupts? kill signals? unsure... Hi. I have some cshell source code that isn't performing quite the way I intend. I have extracted the relevant code, below. ---------- #!/bin/csh onintr clean_up while (1) work_like_a_horse sleep 10 end clean_up: clean_up_horses_mess ---------- Now, when the process is in the foreground, and I interrupt it it with ^C, it halts nicely, cleaning itself up. However, when the process is in the background, and I send it a kill signal, it just plain rolls over and dies. No clean up is performed (leaving all kinds of junk in /tmp :-). Have I misinterpreted this excerpt from 'man csh'? onintr onintr - onintr label Control the action of the shell on interrupts. The first form restores the default action of the shell on interrupts which is to terminate shell scripts or to return to the terminal command input level. The second form `onintr -' causes all interrupts to be ignored. ########################################################### # The final form causes the shell to execute a `goto # # label' when an interrupt is received or a child process # # terminates because it was interrupted. # ########################################################### In any case, if the shell is running detached and interrupts are being ignored, all forms of onintr have no meaning and interrupts continue to be ignored by the shell and all invoked commands. I got the impression that - well, you can tell that I always intend to execute the clean up code ANY time the process is gunned, despite the caliber. What does it take? Thanks in advance... Silver {...topaz!gaynor}