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

{ exit } always { foo }



The documentation of the try-always construct says:

    An tt(exit) command (or a tt(return) command executed at the outermost
    function level of a script) encountered in tt(try-list) does em(not) cause
    the execution of var(always-list).  Instead, the shell exits immediately
    after any tt(EXIT) trap has been executed.

However, A01grammar.ztst expects the always-list to be run:

  723	  (
  724	  mywrap() { echo BEGIN; true; echo END }
  725	  mytest() { { exit 3 } always { mywrap }; print Exited before this }
  726	  mytest
  727	  print Exited before this, too
  728	  )
  729	3:Exit and always block with functions: simple
  730	>BEGIN
  731	>END

Which is correct, the manual or the test?



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