From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4833 invoked from network); 2 Jun 2002 16:08:59 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 2 Jun 2002 16:08:59 -0000 Received: (qmail 8878 invoked by alias); 2 Jun 2002 16:08:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17271 Received: (qmail 8863 invoked from network); 2 Jun 2002 16:08:50 -0000 From: "Bart Schaefer" Message-Id: <1020602160820.ZM10190@candle.brasslantern.com> Date: Sun, 2 Jun 2002 16:08:20 +0000 X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: EXIT trap executes too late? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii "The functions beginning `TRAP' may alternatively be defined with the trap builtin: this may be preferable for some uses, as they are then run in the environment of the calling process, rather than in their own function environment." That doesn't appear to be true for the EXIT trap: schaefer<502> function showtrap () { function> setopt localoptions localtraps function> x='Global value of $x' function> local x='Local value of $x' function> trap 'print $x' EXIT INT function> sleep 5 function> } schaefer<503> showtrap Local value of $x Global value of $x schaefer<504> showtrap Global value of $x -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net