Re: Simple exit trap doesn't run in newer versions of bash

2019-03-01 Thread Chet Ramey
> > (trap "echo WORKS" EXIT; touch x) > > (trap "echo WORKS" EXIT && touch x) > > bash -c 'trap "echo WORKS" EXIT; true' > > bash -c 'trap "echo WORKS" EXIT; false' > > bash -c 'trap "echo WORKS" EXIT; touch x && a' > > bash -c 'trap "echo WORKS" EXIT; touch x; a' > > > > They all produce the outp

Re: Simple exit trap doesn't run in newer versions of bash

2019-01-25 Thread Chet Ramey
On 1/25/19 10:22 AM, Brad Spencer wrote: > Consider the following commands: > > bash -c 'trap "echo WORKS" EXIT; touch x' > (trap "echo WORKS" EXIT; touch x) > (trap "echo WORKS" EXIT && touch x) > bash -c 'trap "echo WORKS" EXIT; true' > bash -c 'trap "echo WORKS" EXIT; false' > bash -c 'trap "ec

Re: Simple exit trap doesn't run in newer versions of bash

2019-01-25 Thread Eduardo A . Bustamante López
On Fri, Jan 25, 2019 at 11:22:07AM -0400, Brad Spencer wrote: (...) > Now consider this command: > > bash -c 'trap "echo WORKS" EXIT && touch x' > > On newer versions of bash, it produces no output. Substituting different > commands in the trap or tracing it seems to indicate that the trap never