Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!linac!uwm.edu!spool2.mu.edu!samsung!munnari.oz.au!uhccux!waikato.ac.nz!aukuni.ac.nz!russell From: russell@ccu1.aukuni.ac.nz (Russell J Fulton;ccc032u) Newsgroups: comp.lang.perl Subject: interupts and perl scripts that call 'system' Message-ID: <1991Jan11.042921.815@ccu1.aukuni.ac.nz> Date: 11 Jan 91 04:29:21 GMT Distribution: comp Organization: University of Auckland, New Zealand. Lines: 25 I recently had a perl script run away on me. (The bug was mine!) Anyway this script called system to delete files repeatedly. When I tried to us ^C to stop the program the ^C appearently killed the currently active system("rm -r ..."), but did not kill the driving script. And yes, you've guessed, it was happly working its way through the passwd file deleting all the users I wanted to keep!! What I did in the end was to start another shell and use kill to stop the perl script. I have just spent all of today putting the system back together. My question is: was there a quick way I could have stopped the script? or alternatively is there some way I can detect that system was terminated by an interupt? (I have tried to read the man page for wait(2) for our system to find out what wait returns but I could not make much sense out of it.) Russell. -- Russell Fulton, Computer Center, University of Auckland, New Zealand.