in an interactive shell, function definitions eval’ed in another function
get a line number of 0 in declare -F output and in the presence of a DEBUG
trap, they get some really bogus negative number (seems to depend on the
line number where the function executed in the trap was defined?)

$ s() { eval "x() { :; }"; }; s; declare -F x
x 0 main

OTOH:

# filename: /tmp/rc#shopt -s extdebugf() { :; }
trap f DEBUG

$ $BASH --rcfile /tmp/rc
$ s() { eval "x() { :; }"; }; s; declare -F x
x -3 main

​

Reply via email to