Finding where an executable was run from -- a proposal.
Andrew Klossner
andrew at frip.gwd.tek.com
Thu May 19 04:01:14 AEST 1988
[]
"The convention used by ksh-i is to put the full pathname used
to exec a file in the environment variable "_"."
This is similar to the proposal of a few months ago that the shell
stuff the unparsed command line into an environment variable, and
suffers from the same problem, exemplified thus:
ksh invokes /bin/fubar, sets "_" to "/bin/fubar"
/bin/fubar does an exec() of /etc/fubar, leaves "_" alone.
Now /etc/fubar sees "_" = "/bin/fubar"
A solution to this problem must be universal across all flavors of
exec(), not just system().
-=- Andrew Klossner (decvax!tektronix!tekecs!andrew) [UUCP]
(andrew%tekecs.tek.com at relay.cs.net) [ARPA]
More information about the Comp.unix.wizards
mailing list