Re: BASH_SOURCE contains incorrect information in Bash 5.3.0
From:
Chet Ramey
Subject:
Re: BASH_SOURCE contains incorrect information in Bash 5.3.0
Date:
Fri, 8 Aug 2025 09:31:20 -0400
User-agent:
Mozilla Thunderbird
On 8/8/25 8:57 AM, Luca Saiu wrote:
Hello.
I am writing a complex Bash script which on failure prints a stack
trace. After upgrading to Bash 5.3.0 I noticed a strange change of
behaviour in BASH_SOURCE which I believe is a bug.
I can't reproduce it. Using your script, I get
$ ./bash ./f-g
BASH_VERSION: 5.3.0(210)-maint
FUNCNAME: 'f' 'g' 'g' 'g' 'g' 'main'
BASH_SOURCE: './f-g' './f-g' './f-g' './f-g' './f-g' './f-g'
$ ../bash-5.3-patched/bash ./f-g
BASH_VERSION: 5.3.3(1)-release
FUNCNAME: 'f' 'g' 'g' 'g' 'g' 'main'
BASH_SOURCE: './f-g' './f-g' './f-g' './f-g' './f-g' './f-g'
$ ../bash-5.3/bash ./f-g
BASH_VERSION: 5.3.0(2)-release
FUNCNAME: 'f' 'g' 'g' 'g' 'g' 'main'
BASH_SOURCE: './f-g' './f-g' './f-g' './f-g' './f-g' './f-g'
using the current devel version, bash-5.3 patchlevel 3, and bash-5.3 as
released, respectively.
--
``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/