How does the command 'which' work? The symbolic link /proc/self/exe will
point to the absolute path.

-----Original Message-----
   In general, you have to know the name of the program (argv[0]
 may be incorrect) and then have to look at the users PATH
 environment to find it...

   That is - you have to look at argv[0] to see if it's a direct
 path specification (begins with '/' or '.').   If it's not,
 then you look along the PATH environment variable to find
 argv[0].

  This approach does not work if the program is being exec'd
 and the exec() call sets argv[0] to something strange.

Reply via email to