Here's the one file (func-file):
-------------------------
Line()
{
echo This is line $@
}
-------------------------
That one is called by this one:
-------------------------
#!/bin/bash
. ./func-file
Line $LINENO
------------------------
Macintosh-5:/tmp joshuagimer$ cat func-file
Line()
{
echo This is line $@
}
Macintosh-5:/tmp joshuagimer$ cat test.sh
#!/bin/bash
. ./func-file
Line $LINENO
Macintosh-5:/tmp joshuagimer$ bash test.sh
This is line 5
Thanks
Josh
On Sat, Nov 14, 2009 at 5:37 PM, ken <gebser@xxxxxxxxxxxx> wrote:
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):
-------------------------
Line()
{
echo This is line "$LINENO" $@
}
-------------------------
That one is called by this one:
-------------------------
#!/bin/bash
. ./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?
tia
--
War is a failure of the imagination.
--William Blake
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos
--
Thx
Joshua Gimer
_______________________________________________ CentOS mailing list CentOS@xxxxxxxxxx http://lists.centos.org/mailman/listinfo/centos