bug-bash
[Top][All Lists]
Advanced

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

Re: wrong lineno inside trap?


From: Eric Blake
Subject: Re: wrong lineno inside trap?
Date: Fri, 09 Jan 2009 18:44:40 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to peter360 on 1/9/2009 6:07 PM:
> trap '
> 
> echo this is line 3, but LINENO=$LINENO
> 
> ' 0
> 
> echo this is line 7, and LINENO=$LINENO

> Is this a known problem?   Thanks.

In general, LINENO handling is inconsistent among shells.  The presence of
single vs. multi-line constructs, eval, here-docs, and shell functions
cause different shells to give different values to LINENO.  For more
documentation on this, see:
http://www.gnu.org/software/autoconf/manual/html_node/Special-Shell-Variables.html#Special-Shell-Variables

and this update to the documentation source, detailing even more
inconsistencies:
http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=10d26aa

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkln/YgACgkQ84KuGfSFAYAiHQCfXdr95aIJvrb7NzunhvYDgEiU
fyQAnj2yJ/gkRLRrvWJeqAOR1CnDKflj
=NtxW
-----END PGP SIGNATURE-----




reply via email to

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