bug-bash
[Top][All Lists]
Advanced

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

Re: bug-report: debug trap messes up pipestatus if containing command su


From: Henning
Subject: Re: bug-report: debug trap messes up pipestatus if containing command substitution
Date: Wed, 22 May 2019 16:41:36 +0200
User-agent: Mozilla/5.0 (Windows NT 6.3; rv:56.0) Gecko/20100101 Thunderbird/56.0

On 22/05/2019 16:27, Chet Ramey wrote:
On 5/21/19 12:51 AM, Hengyang Zhao wrote:
Dear bash developers,

I found an unexpected behavior when engineering some code in a callback of
DEBUG trap. The code has been distilled to expose this behavior:

### BEGIN
my_func() {
   local x=$(:)
}
trap my_func DEBUG
false | true | false | true | false
echo ${PIPESTATUS[@]}
# expects 1 0 1 0 1
# gets 0 0 0 0 1
### END

Thanks for the report. This appears to be a Linux-only problem (at least I
can't reproduce it on Mac OS X). I'll fix it for the next devel push.

Chet


Same with bash 4.4.12 on Cygwin

Henning



reply via email to

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