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

Marc E. Rouleau mer6g at uvaarpa.virginia.edu
Wed May 18 22:16:58 AEST 1988


In article <107 at lakart.UUCP> dg at lakart.UUCP (David Goodenough) writes:
> [ some examples pointing out that (in some cases) what ends up in
>   argv[0] can be turned into a full pathname by prepending `pwd` to it ]

This technique works only if the program being executed is invoked by
specifying a relative or absolute path for it.  If it is found by your
shell as specified by your $PATH variable, all bets are off ...

The whole point of John Gilmore's proposal was to address this problem
of executables being found by path-search and therefore having no
invocation-time knowledge of where they reside.

	-- Marc Rouleau



More information about the Comp.unix.wizards mailing list