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

Re: How to trap to script EXIT instead of function EXIT?



On Sun, Dec 2, 2018 at 8:10 PM Peng Yu <pengyu.ut@xxxxxxxxx> wrote:
>
> The following example shows that `trap` inside a function is trapped
> to the function. This behavior is different from bash. Is there a way
> to make it the same as bash?

setopt posixtraps

Or more generally, "emulate sh".



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