Re: declare -F incorrect line number

2022-10-11 Thread Martin D Kealey
You do realize that there are no "nested functions" in bash, right? Graycat, talk to me on Libera if you really doubt my understanding. All functions exist in a single, global function namespace. > > unicorn:~$ bash > unicorn:~$ f() { g() { echo I am g; }; } > unicorn:~$ f > unicorn:~$ type g >

Re: declare -F incorrect line number

2022-10-08 Thread Chet Ramey
On 10/2/22 4:51 AM, Daniel Castro wrote: Bash Version: 5.0 Patch Level: 17 Release Status: release Description: declare -F yields the wrong line number for a function that has nested functions declared within. Instead it gives the line number of the last nested

Re: declare -F incorrect line number

2022-10-06 Thread Greg Wooledge
On Fri, Oct 07, 2022 at 01:28:59AM +1000, Martin D Kealey wrote: > I write nested functions quite often, usually with a subsequent `unset -f` > but sometimes (necessarily) without. > > Being able to write `local -F funcname { ... }` or `function -L funcname { > ... }` would be a nice replacement

Re: declare -F incorrect line number

2022-10-06 Thread Martin D Kealey
I write nested functions quite often, usually with a subsequent `unset -f` but sometimes (necessarily) without. Being able to write `local -F funcname { ... }` or `function -L funcname { ... }` would be a nice replacement for the former, but the latter is usually about different phases of

Re: declare -F incorrect line number

2022-10-06 Thread Chet Ramey
On 10/5/22 6:29 PM, Robert Elz wrote: Date:Wed, 5 Oct 2022 15:36:55 -0400 From:Chet Ramey Message-ID: <3d89acac-4c0a-64c9-e22c-1a3ca6860...@case.edu> | Other than that, there's no advantage. There can be. I have, on occasion (not in bash - I don't write

Re: declare -F incorrect line number

2022-10-05 Thread Robert Elz
Date:Wed, 5 Oct 2022 15:36:55 -0400 From:Chet Ramey Message-ID: <3d89acac-4c0a-64c9-e22c-1a3ca6860...@case.edu> | Other than that, there's no advantage. There can be. I have, on occasion (not in bash - I don't write bash scripts) had a need to redefine one of

Re: declare -F incorrect line number

2022-10-05 Thread Chet Ramey
On 10/5/22 3:32 PM, Daniel Castro wrote: In this case I’m not doing anything too fancy: my use case is I have a main project script where I declare functions that can get executed independently with some prefix: e.g. ``x.build()``, ``x.test()`` so I can call ``myscript test`` or ``myscript

RE: declare -F incorrect line number

2022-10-05 Thread Daniel Castro
: Re: declare -F incorrect line number On 10/2/22 4:51 AM, Daniel Castro wrote: > Bash Version: 5.0 > > Patch Level: 17 > > Release Status: release > > > Description: > > declare -F yields the wrong line

Re: declare -F incorrect line number

2022-10-05 Thread Chet Ramey
On 10/2/22 4:51 AM, Daniel Castro wrote: Bash Version: 5.0 Patch Level: 17 Release Status: release Description: declare -F yields the wrong line number for a function that has nested functions declared within. Instead it gives the line number of the last

declare -F incorrect line number

2022-10-02 Thread Daniel Castro
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-Smvct5/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses