[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $LINENO in a bash script using subshells in if statements
From: |
Chet Ramey |
Subject: |
Re: $LINENO in a bash script using subshells in if statements |
Date: |
Fri, 5 Jul 2019 21:46:00 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 |
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/