> For bonus points, is it possible to defun AS_EXIT as plain exit for as > long as the trap isn't in place, or as '(exit X); exit X' for as long > as we are before any shell function, and the redefun it as the cool > version at that point? That way you could keep using AS_EXIT > everywhere, consistently.
Yes, indeed. > FWIW, I didn't try your patch because it seemed to be mangled on the > way, but it looks like the function you're using to exit does not avoid > the zsh exit status in function bug. (Yes, I know the shell is supposed > to be rejected, but if poor sap has no other one?) I don't think so. "Do (exit 1) and test $?" fails on zsh, but "do return 1 and test $?" succeeds. Paolo
