bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug with && in piped functions in minimal-config bash


From: Martijn Dekker
Subject: Re: Bug with && in piped functions in minimal-config bash
Date: Fri, 4 Nov 2016 22:42:39 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

Op 04-11-16 om 21:41 schreef Martijn Dekker:
> $ fn() { false && echo bug || echo ok; }
> $ fn
> ok
> $ fn
> ok
> $ fn | cat
> ok
> $ fn | cat
> bug
> $ fn | cat
> bug
> $ (fn) | cat
> ok

Another datapoint: the result and output is exactly as above even if you
use if/then/else.

fn() { if false; then echo bug; else echo ok; fi; }

Thanks,

- M.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]