bug-bash
[Top][All Lists]
Advanced

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

[minor] declare -F issues w/ eval'ed functions


From: Grisha Levit
Subject: [minor] declare -F issues w/ eval'ed functions
Date: Tue, 31 May 2016 21:09:31 -0400

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 extdebug
f() { :; }
trap f DEBUG
$ $BASH --rcfile /tmp/rc
$ s() { eval "x() { :; }"; }; s; declare -F x
x -3 main

reply via email to

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