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

Re: Unexpected behavior with pipe_fail and err_return



On 3/28/20, Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx> wrote:
> () {
>   emulate -L zsh -o pipe_fail -o err_return
>   false | while false; do; done
>   echo $?
> }
>
> This prints "1". Is this expected? I was hoping for no output.

FWIW, you can do this as a workaround
() {
  emulate -L zsh -o pipe_fail -o err_return
  ( false | while false; do; done )
  echo $?
}

-- 
Mikael Magnusson



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