[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug with && in piped functions in minimal-config bash
From: |
Martijn Dekker |
Subject: |
Bug with && in piped functions in minimal-config bash |
Date: |
Fri, 4 Nov 2016 21:41:04 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
My development with Modernish just exposed the following bug on bash
4.4.0(1)-maint, bash-20161028 snapshot, compiled with
--enable-minimal-config --enable-alias:
$ fn() { false && echo bug || echo ok; }
$ fn
ok
$ fn
ok
$ fn | cat
ok
$ fn | cat
bug
$ fn | cat
bug
$ (fn) | cat
ok
So apparently this only occurs if the function is piped into another
command, without explicitly declaring it to run in a subshell, and only
from the second time on.
Thanks,
- M.
- Bug with && in piped functions in minimal-config bash,
Martijn Dekker <=