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


Groups > gnu.bash.bug > #15084 > unrolled thread

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

Started byChet Ramey <chet.ramey@case.edu>
First post2019-07-05 21:46 -0400
Last post2019-07-05 21:46 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

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

FromChet Ramey <chet.ramey@case.edu>
Date2019-07-05 21:46 -0400
SubjectRe: $LINENO in a bash script using subshells in if statements
Message-ID<mailman.266.1562377584.2688.bug-bash@gnu.org>
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/

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web