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

[BUG] Trap and local variable



Hello,
following code:

b() { integer locl=1337; globl=2337; a() { echo "$locl, $globl"; };
trap "a" EXIT }; b

outputs only 2337. If one tries this first:

integer locl=1337; globl=2337; a() { echo "$locl, $globl"; }; b() {
trap "a" EXIT }; b

then the previous version will also work fine.

Best regards,
Sebastian Gniazdowski



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