Re: Function declarations produce no trace nor trigger debug trap while having side effects

2022-10-31 Thread Chet Ramey
On 10/28/22 12:09 PM, Erik Adelbert wrote: Hello Chet and other bash maintainers, Thanks for your time. On 27 Oct 2022, at 23:26, Chet Ramey > wrote: we believe the current semantic to be at least unclear and would like to see either: 0 the DEBUG trap called

Re: Function declarations produce no trace nor trigger debug trap while having side effects

2022-10-28 Thread Oğuz
28 Ekim 2022 Cuma tarihinde Erik Adelbert yazdı: > > 1 there is an error > 2 the debug TRAP is not invoked before the function definition > 3 the function definition is required to return 0 if successful > 4 the debug TRAP is invoked after the successful function definition > >

Re: Function declarations produce no trace nor trigger debug trap while having side effects

2022-10-28 Thread Erik Adelbert
Hello Chet and other bash maintainers, Thanks for your time. > On 27 Oct 2022, at 23:26, Chet Ramey wrote: > > we believe the current semantic to be at least unclear and would like to see > either: >> 0 the DEBUG trap called _before_ any function declaration (preferred) > > While calling the

Re: Function declarations produce no trace nor trigger debug trap while having side effects

2022-10-27 Thread Chet Ramey
On 10/27/22 11:33 AM, Erik Adelbert wrote: Bash Version: 5.2 Patch Level: 2 Release Status: release Description: We have found that [https://www.gnu.org/software/bash/manual/bash.html#Shell-Functions shell function] _declarations_: 0 do not emit trace output 0 do not call DEBUG trap 0 modify

Re: Function declarations produce no trace nor trigger debug trap while having side effects

2022-10-27 Thread Oğuz
27 Ekim 2022 Perşembe tarihinde Erik Adelbert yazdı: > Unless we have missed the related documentation, > You have. > trap [-lp] [[arg] sigspec ...] > [...] If a sigspec is DEBUG, the command > arg is executed before every simple command, for > command, case command, select command, every