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

Re: "set -e" handling is broken with zsh 5.3.1 and 5.4.1



Vincent Lefevre wrote on Sun, 27 Aug 2017 02:50 +0200:
> ----------------------------------------
> #!/usr/bin/env zsh
> 
> set -e
> 
> f()
> {
>   [[ -z 1 ]] && false
> }
> 
> if false; then
>   :
> else
>   f
>   echo Fail 1
>   echo Fail 2
>   f
>   echo Fail 3
> fi
> ----------------------------------------
> 
> I suppose that cond2-e should die just after f is called, before
> outputting anything. At least, the behavior is not consistent.

That's what happens if [[ is changed to [, or put into a subshell.



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