On Mon, Apr 6, 2015 at 8:04 AM, Eduardo A. Bustamante López <dual...@gmail.com> 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! Thanks, - Scott