bug-bash
[Top][All Lists]
Advanced

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

LINENO incorrectly altered after first func call w/in a func


From: Grant Jacobs
Subject: LINENO incorrectly altered after first func call w/in a func
Date: Tue, 15 Oct 2002 12:46:51 +1300

The following code:
---------------------------------------
function one()
{
  echo "In function one"
}

function two
{
  echo $LINENO ; one ; echo $LINENO
  echo $LINENO ; one ; echo $LINENO
}

echo "$LINENO" ; two ; echo "$LINENO"
---------------------------------------



Produces:
---------------------------------------
15
1
In function one
6
7
In function one
7
15
---------------------------------------


rather than what I'd expect:
---------------------------------------
15
1
In function one
1
2
In function one
2
15
---------------------------------------



Note that only the first call to 'one' is affected. This is true in 2.04.21(1) on Red Hat Linux 7.1 and 2.05a on Mac OS X.


Grant
--
-------------------------------------------------------------------
Grant Jacobs Ph.D.                                     BioinfoTools
ph. +64 3 476 1820  (office)                           PO Box 6129,
or  +64 25 601 5917 (mobile)                               Dunedin,
address@hidden                               NEW ZEALAND.
Bioinformatics tools - software development - consulting - training
Check out the website for more details: http://www.bioinfotools.com




reply via email to

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