[CentOS] bash variable expansion moment

ken gebser at mousecar.com
Sun Nov 15 00:37:44 UTC 2009

It's half a nice Saturday later and many attempts have brought no
satisfaction.  Maybe this can't be done.

I'm trying to write a function which, when called from one function
execute in another.  In itself, that's not the problem.  Rather, there's
one built-in variable which is evaluated in the function definition and
it's value is then set (too early).

Here's the one file (func-file):
echo This is line "$LINENO" $@

That one is called by this one:

. ./func-file

Line ... it should be $LINENO

I want the function Line to show the line number in the second file
where it's executed, not the line number from the sourced function.

Any mavens got the skinny on this?


War is a failure of the imagination.
        --William Blake

More information about the CentOS mailing list