Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Why EXIT traps aren't run inside other traps?



    Hi Vincent :)

 * Vincent Lefevre <vincent@xxxxxxxxxx> 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...



Messages sorted by: Reverse Date, Date, Thread, Author