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

Re: trap does not work in a trap function?



> The attached small script behaves in an unexpected way (at least to me):

Hmpf, the attachment has been stripped from the mail somwhere
on the way:

-- BEGIN sigtest
#!/usr/bin/zsh

shutdown () {
	echo shutdown
	trap - EXIT
	exit 77
}

trap shutdown EXIT
shutdown
-- END sigtest

>   $ ./sigtest
>   shutdown
>   shutdown
> 
> Why is the shutdown function called again by exit when the EXIT trap was
> just removed?  This looks like the trap builtin does not properly work from
> within a trap handler.

-- 
GMX DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 fÃr nur 19,99 Euro/mtl.!*
http://portal.gmx.net/de/go/dsl



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