Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Unexpected behavior with pipe_fail and err_return
- X-seq: zsh-users 24732
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: Unexpected behavior with pipe_fail and err_return
- Date: Sun, 29 Mar 2020 19:34:08 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAHYJk3SLMY=t+DgqH0iGH+t-DX+cOiNJE0MboOWJZiSL6vOKHg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAN=4vMrPFVgaH2fDXxUcNeH1+HORnuc=FOEGkfdqrLWEsMu8QQ@mail.gmail.com> <CAHYJk3SLMY=t+DgqH0iGH+t-DX+cOiNJE0MboOWJZiSL6vOKHg@mail.gmail.com>
On Sun, Mar 29, 2020 at 7:29 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> 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
> [...]
I added `|| return` at the end. Works just as well and doesn't fork.
Is this behavior expected? I thought err_return should trigger
everywhere except for conditions under `if` and `while` and rhs of
`||` and `&&`. Are there additional rules that I'm missing?
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author