[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: |
Hengyang Zhao |
Subject: |
Re: bug-report: debug trap messes up pipestatus if containing command substitution |
Date: |
Thu, 23 May 2019 14:11:26 -0700 |
Awesome! Could you please cc the fix to this thread once it's done? Thank
you!
Hengyang
On Wed, May 22, 2019, 7:27 AM Chet Ramey <chet.ramey@case.edu> 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
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
>