Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15084

Re: $LINENO in a bash script using subshells in if statements

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: $LINENO in a bash script using subshells in if statements
Date 2019-07-05 21:46 -0400
Organization ITS, Case Western Reserve University
Message-ID <mailman.266.1562377584.2688.bug-bash@gnu.org> (permalink)
References <20190705223020.2AF67C61CA9@denver> <73de30aa-87ad-0cf2-3c3f-83a4b3e741b0@case.edu>

Show all headers | View raw


On 7/5/19 6:30 PM, charles.deledalle@gmail.com wrote:

> Bash Version: 5.0
> Patch Level: 3
> Release Status: release
> 
> Description:
> 	Using a subshell environment in an if statement screws up my $LINENO variable, see minimal reproducible code below.
> 	The problem occurs only if the condition is true (meaning the subshell is executed). Same problem occurs if the subshell is in a while/for loop iterating at least once.
> 	The problem occurs with Bash 5.0.3. It does not occur with 4.2.3 or 3.2.57. See discussion here: https://stackoverflow.com/questions/56909685/weird-behavior-of-lineno-in-a-bash-script-using-subshells-in-if-statements

Thanks for the report. This was fixed back in mid-March, and the fix is
in the devel branch.

-- 
``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/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: $LINENO in a bash script using subshells in if statements Chet Ramey <chet.ramey@case.edu> - 2019-07-05 21:46 -0400

csiph-web