bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unreliable value of LINENO variable


From: Phi Debian
Subject: Re: unreliable value of LINENO variable
Date: Tue, 5 Dec 2023 07:51:29 +0100

Confirmed on Ubuntu 22.04.3 LTS
----------------------------------------------

$ cat ~/yo.sh
echo $BASH_VERSION
echo 0 $LINENO
if ((1)); then
   ( : ) | : ; echo 1 $LINENO
fi
echo 2 $LINENO

$ for s in bash ./bash ksh zsh
> do printf "\n$s\n" ; $s ~/yo.sh
> done

bash
5.1.16(1)-release
0 2
1 4
2 5

./bash
5.2.21(5)-release
0 2
1 4
2 5

ksh

0 2
1 4
2 6

zsh

0 2
1 4
2 6



reply via email to

[Prev in Thread] Current Thread [Next in Thread]