in reply to Detect name and path of calling script

Well ... on *nix systems, you cannot reliably do this. Sure, you can get the current process pid, look up the parent pid in the process table and then check the name of the parent process ... but you see, the name of a process is easily spoofed. What exactly are you trying to accomplish? There may be better ways (sudo) to accomplish what you really need.

-derby
  • Comment on Re: Detect name and path of calling script

Replies are listed 'Best First'.
Re^2: Detect name and path of calling script
by Anonymous Monk on Apr 08, 2008 at 13:45 UTC
    This is a *nix system. Unfortunately sudo is not installed on the system (and is not likely to be) or yes I would have used it
    So in a nutshell I'm trying to achieve what sudo would have given me but without the ability to use sudo.