On Thu, Nov 28, 2024 at 08:23:48 +0400, Ivan Shapovalov wrote:
> Bash Version: 5.2
> Patch Level: 37
> Release Status: release
> 
> Description:
>       Regression: When an EXIT trap runs, it runs in global context, i.e.
>       does not see the locals defined in the function that was executing
>       at the time of the exit.

>       Expected behavior in both cases is the same. It was the same until a
>       recent bash release.

Perhaps related to this change, introduced in bash 5.2:

f. Fixed a bug that could cause an EXIT trap to use the wrong variable context
   when the errexit option is set.

(Your sample script is using set -e.)

Reply via email to