bug-bash
[Top][All Lists]
Advanced

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

Re: Bug: Bash forgets sourcefile and linenumber of read-in functions


From: Greg Wooledge
Subject: Re: Bug: Bash forgets sourcefile and linenumber of read-in functions
Date: Mon, 11 Mar 2019 16:34:03 -0400
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Mar 11, 2019 at 01:15:16PM -0700, L A Walsh wrote:
> 1) Where is it documented that if you export a function, the original
> source location is thrown away by bash?

It's not documented so much as blatantly obvious by looking at how it's
implemented.


wooledg:~$ export -f title
wooledg:~$ env | grep -A2 title
BASH_FUNC_title%%=() {  local IFS=' ';
 printf '\e]2;%s\a' "$*"
}


There's nowhere in that variable to store metadata such as original source
file or line number.  You'd need a second variable at the very least.
It would require a modification of the function export/import code, and
this would break compatibility *again* (just like the shellshock patches
did when they changed the implementation).



reply via email to

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