bug-bash
[Top][All Lists]
Advanced

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

Re: bash usage w/ssh question (re: suse10.2)


From: Chet Ramey
Subject: Re: bash usage w/ssh question (re: suse10.2)
Date: Thu, 22 Feb 2007 22:55:20 -0500
User-agent: Thunderbird 1.5.0.9 (Macintosh/20061207)

Linda Walsh wrote:

> Another question (maybe a budding RFE?) is: Is there a way to find
> out (and print the "source stack" -- i.e. nested "calls" using
> "." to source files that are sourcing more...etc.  I know it isn't
> technically a procedure call, but there is a concept of a call
> stack in  that a sourced file is performed as though inserted in
> the current routine, then control resumes at the first line after
> the source.
> Semantically -- it isn't a "call stack", but more akin to the actions
> of a "preprocessor", but "syntactically", it functions much like
> file a calls(sources) b, b calls(sources) c... etc...

Look at the BASH_SOURCE array variable.  It was originally added as
part of the support for the bash debugger, but it does what you want.

Chet


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/




reply via email to

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