Urgent Help with Script Needed

Urgent Help with Script Needed

Post by Barry Margoli » Sat, 27 Feb 1999 04:00:00





>Hello All,
>      I'm a novice korn shell programmer. I need to write a shell
>that can return the name if it's parent process. In other words,
>I have a process named parent_sh. parent_sh calls a script child_sh.
>I want child_sh to be able to print to the screen "I was called by
>parent_sh".
>      My initial thought was to go with ps and an awk script, but ps
>deals more with the command running from the script, rather than the
>script name.

Ps should show the parent's name as "/bin/sh parent_sh".  You can simply
remove /bin/ps to get the name of the script.

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.