From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23468 invoked from network); 18 Sep 2001 11:14:45 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 18 Sep 2001 11:14:45 -0000 Received: (qmail 10121 invoked by alias); 18 Sep 2001 11:14:21 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4238 Received: (qmail 10106 invoked from network); 18 Sep 2001 11:14:20 -0000 Date: Tue, 18 Sep 2001 13:14:16 +0200 From: Michal Vitecek To: zsh-users@sunsite.dk Subject: trap for EXIT doesn't catch exit? Message-ID: <20010918131416.A13937@fuf.sh.cvut.cz> Mail-Followup-To: Michal Vitecek , zsh-users@sunsite.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i greetings, in one of my zsh programs i'm creating a number of temporary files which should be removed when the program execution stops or an error occurs and i call 'exit'. however after having specified 'trap CleanUp EXIT' the clean-up function is not called when 'exit' inside a function is executed. an example program (test.sh): ----start---- #!/bin/zsh function CleanUp() { rm -f tempfile } function WillExit() { exit } trap CleanUp EXIT touch tempfile WillExit ----end---- $ chmod +x test.sh $ ./test.sh $ ls tempfile tempfile $ in my understanding the CleanUp() function should be called, evidently it's not. what's wrong here? thanks for your help, -- fuf ------------------------------ na IRC ------------------------------------- BillGates [bgates@www.microsoft.com] has joined #LINUX ... mode/#linux [+b BillGates!*@*] by DoDad BillGates was kicked off #linux by DoDad (banned: We see enough of Bill Gates already.)