RE: [ILUG] shell script Q

From: Kenn Humborg (kenn at domain bluetree.ie)
Date: Fri 17 Sep 1999 - 13:02:15 IST


John P . Looney writes:
> On Fri, Sep 17, 1999 at 12:07:35PM +0100, Sean McGrath mentioned:
> > > And, later, call it with:
> > > assert "$#" == "5"
> > > Is there any way I can print out the name of the shell function that
> > > assert() was called from ?
> > $LINENO ? In bash anyways.
>
> Good call. Means I've to look up the function that went bad, but it's a
> start. C'mon gurus. This has to be possible.

Can you get the name of the file in code? If so, do something
like:

   head -n $LINENO $FILENAME | grep '^[ ]*function ' | tail -n 1

Kenn



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:04:34 GMT