bug-bash
[Top][All Lists]
Advanced

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

Re: Can no longer assign to LINENO in bash3


From: Chet Ramey
Subject: Re: Can no longer assign to LINENO in bash3
Date: Sat, 01 Jan 2005 21:13:20 -0500
User-agent: Mozilla Thunderbird 0.9 (Windows/20041103)

bronson@rinspin.com wrote:
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H  -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2
uname output: Linux lea 2.6.9-1-k7 #1 Wed Dec 15 19:12:42 GMT 2004 i686 
GNU/Linux
Machine Type: i386-pc-linux-gnu

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:

I execute the following script from the prompt, $ . tt.sh

    echo $LINENO
    LINENO=11
    echo $LINENO

When I run it on bash 2.05b I get exactly what I would expect:

    1
    12

But when I trun it on bash 3.0, I get:

    1
    3

Bash version 3 is much more accurate in its line number reporting.  When
in a script, the value of LINENO is set from the line number saved while
parsing the script, rather than simply adding one or two to the last
value.

Chet




reply via email to

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