Finding where an executable was run from -- a proposal.

Ian Sergeant ians at kylie.oz
Tue May 31 11:26:50 AEST 1988


In article <10310 at ulysses.homer.nj.att.com>, dgk at ulysses.homer.nj.att.com (David Korn[eww]) writes:
> 
> ksh passes the full pathname of the executable as the first environment
> variable and names it _.  Thus, if the program is run by ksh,
> genenv("_"); returns a pathname for the executable.  Now if everyone
> would follow this convention the problem would be solved.
> 
> David Korn
> ulysses!dgk

A convention is not good enough.  I know of no absolutely reliable way
of finding out what the absolute pathname of an executable is when you
exec it.

You need to be able to read all the ".." directories to be able to reliably
determine the pathname of a file in your current directory in any environment.

Ian.
-- 
Ian Sergeant            ACSnet: ians at kylie.oz
			Internet: ians at kylie.oz.au@uunet.uu.net
==



More information about the Comp.unix.wizards mailing list