[Top][All Lists]

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

Re: Second trap invocation is ignored?

From: Scott Bronson
Subject: Re: Second trap invocation is ignored?
Date: Mon, 6 Apr 2015 08:11:59 -0700

On Mon, Apr 6, 2015 at 8:04 AM, Eduardo A. Bustamante López
<address@hidden> wrote:
> There is no bug. Simply, your expectations on when the DEBUG trap runs are
> wrong.
> The `script2' I provided ran with set -T is the closest you'll get to what you
> expect, but, since DEBUG runs *before* the source command, it'll not work as
> you want.

True, but that doesn't explain why the first sourced invocation
succeeds, but all
invocations thereafter fail.

Is there a reason for this behavior?  Why should a call to trap succeed or fail
depending on whether the trap is already set or not?  If that's
expected behavior,
I would certainly like to document it!


   - Scott

reply via email to

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