bash documentation about BASH_LINENO and BASH_SOURCE is vague and inconsistent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: bash
The bash manual should be updated with something like the following. For more details see
https:/
`BASH_SOURCE'
An array variable whose members are the source filenames where
the corresponding elements in the `FUNCNAME' array variable are
defined. For instance the function `${FUNCNAME[$i]}' is defined
in the file `${BASH_
`$
`BASH_LINENO'
An array variable whose members are the line numbers in source
files where the corresponding members of FUNCNAME were called.
For instance the function `${FUNCNAME[$i]}' was called at line
number `${BASH_
Use `LINENO' to obtain the current line number. See `FUNCNAME'.
`FUNCNAME'
An array variable containing the names of all shell functions
currently in the execution call stack. The element with index 0
is the name of any currently-executing shell function. The
bottom-most element is `"main"'. This variable exists only when a
shell function is executing. Assignments to `FUNCNAME' have no
effect and return an error status. If `FUNCNAME' is unset, it
loses its special properties, even if it is subsequently reset.
This variable is most useful together with `BASH_SOURCE' and
`BASH_LINENO'. For instance `${FUNCNAME[0]}' is the name of the
currently running function, it was called in file
`$
a back trace of the call stack to stderr use the following
function
BT () {
i=1 # leave out BT from the call stack; set to 0 to include BT
until test "${FUNCNAME[$i]}" = "main" -o "${FUNCNAME[$i]}"
do
echo "${FUNCNAME[$i]} called from ${BASH_
let i++
done
}
Why is this still marked as 'new'? It is a simple clarification of the bash info-pages.