On Fri, 1 Oct 2010 11:00:33 -0600
Darren Kirby wrote:

> On Fri, Oct 1, 2010 at 10:29 AM, Dale <[email protected]> wrote:
> > Al wrote:
> >>
> >> Hello,
> >>
> >> I want to find out by which file and line the */temp/environment
> >> script is run or sourced.
> >>
> >> As a am always interested in a general way to solve something, I
> >> ask if there is a tool, that displays me the order in which  files
> >> are read by a process.
> >>
> >> Al
> >>
> >>
> >
> > I'm not sure but you may want to check into strace.  It may be what
> > you are looking for.
> >
> 
> strace may do the job in a pinch, but there is almost certainly
> something better suited to the task...however I don't know what it is.
> You may want to use like this:
> 
> $ strace YourScript 2>&1 | grep open

No need to use grep to find the open operations.  strace has a -feopen
option, i.e.

  strace -feopen YourScript

> 
> which will run YourScript and print all open() system calls to the
> console. You will have to sort through many unrelated calls (such as
> reading shared library calls) but it will show the order in which your
> script is opening external files. Presumably you could key in on the
> relevant files using more grep calls and pipes...
> 
> >
> > Dale
> >
> > :-)  :-)
> >
> >
> 
> 
> D
> -- 
> --
> Support the mob or mysteriously disappear...
> I'm on flickr: http://www.flickr.com/photos/badcomputer/

Reply via email to