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

Re: Bug with trap?



On Mon, May 03, 2010, Peter Stephenson wrote about "Re: Bug with trap?":
> I was wondering along the lines you suggest, but the counterargument is

I see now... So you expected the trap to go off when the subshell exited,
not when the current shell exits...
Maybe subshells simply do not perform EXIT traps when they exit? try

	(trap 'echo hi' EXIT)

It does *not* print "hi", while a standalone shell,
	sh -c "trap 'echo hi' EXIT"
does print hi.

-- 
Nadav Har'El                        |       Monday, May  3 2010, 20 Iyyar 5770
nyh@xxxxxxxxxxxxxxxxxxx             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |A conscience does not prevent sin. It
http://nadav.harel.org.il           |only prevents you from enjoying it.



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