On Sun, Jun 5, 2016 at 8:48 PM, Chet Ramey <chet.ra...@case.edu> wrote:
> "Traced functions inherit the DEBUG  and  RETURN  traps  from  the  calling
> shell."

Why did RETURN originally get sucked into set -T? Was it supposed to
be primarily for debugging? Some functions actually use it for
internal purposes and enabling -T to debug causes (probably unwanted)
side-effects in such cases since there's no way to control their
inheritance separately.

If the goal is to inspect values when a function returns that can be
accomplished with just a DEBUG trap:
trap 'if [[ $LASTFUNC != ${FUNCNAME[0]} ]]; then ...;
LASTFUNC=${FUNCNAME[0]}; fi' DEBUG

Reply via email to