diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2017-09-12 23:22:34 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2017-09-12 23:22:34 +0200 |
commit | 4aaf06e6678dcead65d7226bd6bde3cffeb2cb2e (patch) | |
tree | 5c8e2ac2c9a85e2e6568aed7120372e6efa074ac /Doc/Zsh/options.yo | |
parent | f33de64abf57611e59df72da230f3d0d6760c4c5 (diff) | |
parent | 6ff4787e830f8edb3a7e32490a88a131e4b62f7f (diff) | |
download | zsh-4aaf06e6678dcead65d7226bd6bde3cffeb2cb2e.tar.gz zsh-4aaf06e6678dcead65d7226bd6bde3cffeb2cb2e.zip |
Merge tag 'zsh-5.4.2' into debian
Release 5.4.2
Diffstat (limited to 'Doc/Zsh/options.yo')
-rw-r--r-- | Doc/Zsh/options.yo | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index 70092d681..42571fccd 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -1659,6 +1659,13 @@ as it is by default, and the option tt(ERR_EXIT) is found to have been set on exit, then the command for which the tt(DEBUG) trap is being executed is skipped. The option is restored after the trap exits. +Non-zero status in a command list containing tt(&&) or tt(||) is ignored +for commands not at the end of the list. Hence + +example(false && true) + +does not trigger exit. + Exiting due to tt(ERR_EXIT) has certain interactions with asynchronous jobs noted in ifzman(the section JOBS in zmanref(zshmisc))\ @@ -1672,10 +1679,25 @@ cindex(function return, on error) cindex(return from function, on error) item(tt(ERR_RETURN))( If a command has a non-zero exit status, return immediately from the -enclosing function. The logic is identical to that for tt(ERR_EXIT), +enclosing function. The logic is similar to that for tt(ERR_EXIT), except that an implicit tt(return) statement is executed instead of an tt(exit). This will trigger an exit at the outermost level of a non-interactive script. + +Normally this option inherits the behaviour of tt(ERR_EXIT) that +code followed by `tt(&&)' `tt(||)' does not trigger a return. Hence +in the following: + +example(summit || true) + +no return is forced as the combined effect always has a zero return +status. + +Note. however, that if tt(summit) in the above example is itself a +function, code inside it is considered separately: it may force a return +from tt(summit) (assuming the option remains set within tt(summit)), but +not from the enclosing context. This behaviour is different from +tt(ERR_EXIT) which is unaffected by function scope. ) pindex(EVAL_LINENO) pindex(NO_EVAL_LINENO) |