Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14779 > unrolled thread

Re: The builtin array variable 'FUNCNAME' is considered unset by many expansions, even when set.

Started byGreat Big Dot <greatbigdot@gmail.com>
First post2018-11-08 10:28 -0500
Last post2018-11-08 10:28 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: The builtin array variable 'FUNCNAME' is considered unset by many expansions, even when set. Great Big Dot <greatbigdot@gmail.com> - 2018-11-08 10:28 -0500

#14779 — Re: The builtin array variable 'FUNCNAME' is considered unset by many expansions, even when set.

FromGreat Big Dot <greatbigdot@gmail.com>
Date2018-11-08 10:28 -0500
SubjectRe: The builtin array variable 'FUNCNAME' is considered unset by many expansions, even when set.
Message-ID<mailman.3655.1541690948.1284.bug-bash@gnu.org>
> It should expand to the empty string in all these cases.

Oh yeah, right, because a function isn't even running. Duh. All my comments
about expected behavior should be inverted, then, I guess. Out of
curiosity, do you have any idea what's causing bash to *sometimes*
correctly conclude that FUNCNAME[0] is empty and other times that
FUNCNAME[*] is empty, under seemingly arbitrary circumstances? I can't
figure out what could be causing that.

On Thu, Nov 8, 2018 at 9:57 AM Chet Ramey <chet.ramey@case.edu> wrote:

> On 11/8/18 1:15 AM, Great Big Dot wrote:
>
> > Bash Version: 4.4
> > Patch Level: 23
> > Release Status: release
> >
> > Description:
> > The builtin array variable FUNCNAME (which provides a way to trace the
> > stack of functions called so far) appears to be unset according to
> certain
> > bash expansions, even when it isn't. If the following code is saved to a
> > file and executed (this doesn't work at the command line), the problems
> > begin to appear:
> >
> >     printf -- '%q\n' "${FUNCNAME}"
> >     printf -- '%q\n' "${FUNCNAME[0]}"
> >     printf -- '%q\n' "${FUNCNAME[*]}"
>
> Thanks for the report. It should expand to the empty string in all these
> cases.
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
>

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web