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

Re: Behavior of calling return from a trap

2012-04-10 Thread Chet Ramey
On 2/15/12 7:51 PM, dave reisner wrote: > 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 "shoul