zsh-users
 help / color / mirror / code / Atom feed
* Why EXIT traps aren't run inside other traps?
@ 2006-01-05 22:11 DervishD
  2006-01-06 13:01 ` Vincent Lefevre
  0 siblings, 1 reply; 3+ messages in thread
From: DervishD @ 2006-01-05 22:11 UTC (permalink / raw)
  To: Zsh Users

    Hi all :)

    Bash runs EXIT traps within any other trap, and GNU autoconf
seems to depend on this. I know that SUS (POSIX) doesn't say anything
about this, but...

    I've read zsh-users 3513 and a few more messages, but I still
don't know if this is a common behaviour or not.

    As usual, this problem is affecting me because I have to do some
cleanups when exiting, and I want to run the EXIT trap after, let's
say, the INT trap. I could use a function, and call that function
from within the traps, but unfortunately I must write this script for
maximum portability, so functions may be a problem :((((

    Should I live with it? Are there more shells with the same
behaviour?

    Thanks a lot in advance :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why EXIT traps aren't run inside other traps?
  2006-01-05 22:11 Why EXIT traps aren't run inside other traps? DervishD
@ 2006-01-06 13:01 ` Vincent Lefevre
  2006-01-06 21:54   ` DervishD
  0 siblings, 1 reply; 3+ messages in thread
From: Vincent Lefevre @ 2006-01-06 13:01 UTC (permalink / raw)
  To: Zsh Users

On 2006-01-05 23:11:09 +0100, DervishD wrote:
>     Bash runs EXIT traps within any other trap, and GNU autoconf
> seems to depend on this. I know that SUS (POSIX) doesn't say anything
> about this, but...

This is a bug in bash, and the GNU autoconf shouldn't depend on
bash bugs (BTW it will have problems with the traditional sh,
which behave like zsh).

-- 
Vincent Lefèvre <vincent@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Why EXIT traps aren't run inside other traps?
  2006-01-06 13:01 ` Vincent Lefevre
@ 2006-01-06 21:54   ` DervishD
  0 siblings, 0 replies; 3+ messages in thread
From: DervishD @ 2006-01-06 21:54 UTC (permalink / raw)
  To: Zsh Users

    Hi Vincent :)

 * Vincent Lefevre <vincent@vinc17.org> dixit:
> On 2006-01-05 23:11:09 +0100, DervishD wrote:
> >     Bash runs EXIT traps within any other trap, and GNU autoconf
> > seems to depend on this. I know that SUS (POSIX) doesn't say anything
> > about this, but...
> 
> This is a bug in bash, and the GNU autoconf shouldn't depend on
> bash bugs (BTW it will have problems with the traditional sh,
> which behave like zsh).

    I didn't know if that was a bash bug (that's why I was asking),
and I think exactly the same: autoconf shouldn't depend on bash bugs.
It has done in the past, but they aren't the only ones. Many
supposedly portable shell scripts out there doesn't asume "Bourne" or
"POSIX" or "SUS": they claim that, but they assume Bash...

    Unfortunately, this is a very annoying bug in bash, then. If I
write my traps so the cleanup is done in every trap, under Bash it
will be done twice, one in the corresponding trap and another in the
EXIT trap. Of course I've written the code to behave properly if this
happens.

    Thanks for the information :))

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-01-06 21:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-05 22:11 Why EXIT traps aren't run inside other traps? DervishD
2006-01-06 13:01 ` Vincent Lefevre
2006-01-06 21:54   ` DervishD

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).