[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: unreliable value of LINENO variable
From: |
Chet Ramey |
Subject: |
Re: unreliable value of LINENO variable |
Date: |
Thu, 7 Dec 2023 12:17:04 -0500 |
User-agent: |
Mozilla Thunderbird |
On 12/4/23 2:24 PM, Giacomo Comes wrote:
The script I was using was more complicated.
I did simplify it and I tested the simpler version only with bash 5.0, assuming
it would fail with 5.1 and 5.2 too.
The following one fails with every 5.x version:
------------------------------------------------
#!/bin/bash
if ((1)); then
( : ) | : ; echo 1 $LINENO
fi
echo 2 $LINENO
------------------------------------------------
Need to add a pipe after the subshell command.
Thanks for the updated example. There are several fixes in the devel
branch regarding LINENO.
This particular issue was fixed back in September, 2022 as the result of
https://savannah.gnu.org/support/index.php?110714
Chet
--
``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/
OpenPGP_signature.asc
Description: OpenPGP digital signature