Re: 5.2.15(1)-release: RETURN trap not executed in cmd subst if last statement of fct is not builtin

2024-07-06 Thread alex xmb sw ratchev
maybe its scope .. 1st define trap 2 define and run func .. On Sat, Jul 6, 2024, 15:02 Emanuele Torre wrote: > On Sat, Jul 06, 2024 at 01:41:01PM +0200, Jens Schmidt wrote: > > Today I came across this one: > > > > [copy-on-select-2]$ echo $BASH_VERSION > > 5.2.15(1)-release > > [copy-on-s

Re: 5.2.15(1)-release: RETURN trap not executed in cmd subst if last statement of fct is not builtin

2024-07-06 Thread Emanuele Torre
On Sat, Jul 06, 2024 at 01:41:01PM +0200, Jens Schmidt wrote: > Today I came across this one: > > [copy-on-select-2]$ echo $BASH_VERSION > 5.2.15(1)-release > [copy-on-select-2]$ foo() { trap 'echo foo' RETURN; /bin/echo bar; } > [copy-on-select-2]$ foo > bar > foo > [copy-on-select-