Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: zsh-4.1.1 and trap '...' DEBUG: a bug or a feature?
- X-seq: zsh-workers 19678
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: "Nelson H. F. Beebe" <beebe@xxxxxxxxxxxxx>
- Subject: Re: zsh-4.1.1 and trap '...' DEBUG: a bug or a feature?
- Date: Tue, 23 Mar 2004 10:20:48 -0800
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <CMM.0.92.0.1080064462.beebe@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <CMM.0.92.0.1080064462.beebe@xxxxxxxxxxxxxxxxx>
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..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author