touch-packages team mailing list archive
-
touch-packages team
-
Mailing list archive
-
Message #29166
[Bug 591677] Re: bash documentation about BASH_LINENO and BASH_SOURCE is vague and inconsistent
And that's what I get for copy/pasting.
export -f import
is supposed to be
export -f myGlobal
I find it odd I can't edit my comment above.
--
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to bash in Ubuntu.
https://bugs.launchpad.net/bugs/591677
Title:
bash documentation about BASH_LINENO and BASH_SOURCE is vague and
inconsistent
Status in “bash” package in Ubuntu:
New
Bug description:
Binary package hint: bash
The bash manual should be updated with something like the following.
For more details see
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/318678
`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_SOURCE[$i]}' (and was called from file
`${BASH_SOURCE[$i+1]}'. See `FUNCNAME'.
`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_LINENO[$i]}' (in the file `${BASH_SOURCE[$i+1]}').
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
`${BASH_SOURCE[1]}' at line number `${BASH_LINENO[0]}'. To print
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_SOURCE[$i+1]}:${BASH_LINENO[$i]}" >&2
let i++
done
}
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash/+bug/591677/+subscriptions