Unix Shell - Re: what alternatives does a shell command have in determining its

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > May 2007 > Re: what alternatives does a shell command have in determining its





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: what alternatives does a shell command have in determining its
Henry Townsend

2007-05-25, 1:24 am

Larry W. Virden wrote:
> I certainly know there is a parent process id in the output of ps.
> However, in many cases, that info is less than useless (when the
> parent process is gone, for instance).
>
> What I need is some code I can put into ksh script abc so that it can
> output the name of the process which started it.
>
> Are there either existing tools, or techniques, by which this
> information could be derived?
>
> I'm currently in an environment where Solaris 8/9/10 are all in use,
> and the script is written in ksh88i


On Solaris, try ptree (and its relatives, collectively known as the
p-tools). On other systems you can download 'pstree', a free program.

Once you have the pid of a process you can use 'pargs' (another p-tool)
to get its command line.

HT
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com