zsh-workers
 help / color / mirror / code / Atom feed
From: Wayne Davison <wayned@users.sourceforge.net>
To: "Nelson H. F. Beebe" <beebe@math.utah.edu>
Cc: zsh-workers@sunsite.dk
Subject: Re: zsh-4.1.1 and trap '...' DEBUG: a bug or a feature?
Date: Tue, 23 Mar 2004 10:20:48 -0800	[thread overview]
Message-ID: <20040323182048.GB30758@blorf.net> (raw)
In-Reply-To: <CMM.0.92.0.1080064462.beebe@psi.math.utah.edu>

On Tue, Mar 23, 2004 at 10:54:22AM -0700, Nelson H. F. Beebe wrote:
> Notice that zsh takes one final DEBUG trap that bash does not.

This is because your EXIT trap had one command in it.  If it had two
commands, you would have seen two final DEBUG trap executions.  One
way to avoid this is to turn off DEBUG in the exit trap:

trap 'trap - DEBUG; echo This is an EXIT trap' EXIT
trap 'echo This is a DEBUG trap' DEBUG
pwd
pwd
pwd
pwd

That would duplicate the bash behavior you saw.  However, I don't know
if this is proper POSIX behavior or not.

..wayne..


  reply	other threads:[~2004-03-23 18:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-23 17:54 Nelson H. F. Beebe
2004-03-23 18:20 ` Wayne Davison [this message]
2004-03-23 18:49 ` Peter Stephenson
2004-03-24 12:29   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040323182048.GB30758@blorf.net \
    --to=wayned@users.sourceforge.net \
    --cc=beebe@math.utah.edu \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).