Behavior of calling return from a trap

2012-03-28 Thread dave reisner
Hi all, I'm noticing some odd behavior in an ERR trap with errtrace. It's present in bash 3.2 and as well as 4.2. The simplest reproduction is as follows: --8<-- #!/bin/bash somefunc() { false echo "shouldn't see this" } set -E trap -- 'return 1' ERR somefunc echo "

Re: Behavior of calling return from a trap

2012-04-10 Thread dave reisner
On Tue, Apr 10, 2012 at 12:04:36PM -0400, Chet Ramey wrote: > You're calling the error trap twice. The first time you call it is after > the `false' in the body of the function, and the `return' works as intended > there. Since you return 1, the call to `somefunc' fails, triggering the > error tr