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 24731
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- Subject: Re: Unexpected behavior with pipe_fail and err_return
- Date: Sun, 29 Mar 2020 19:29:34 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAN=4vMrPFVgaH2fDXxUcNeH1+HORnuc=FOEGkfdqrLWEsMu8QQ@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>
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