Path: utzoo!attcan!uunet!tektronix!orca!tekecs!frip!andrew From: andrew@frip.gwd.tek.com (Andrew Klossner) Newsgroups: comp.unix.wizards Subject: Re: Finding where an executable was run from -- a proposal. Message-ID: <10003@tekecs.TEK.COM> Date: 18 May 88 18:01:14 GMT References: <67@uvaarpa.virginia.edu> <6800012@cpe> <4527@hoptoad.uucp> <4687@watdcsu.waterloo.edu> <53285@sun.uucp> <2920@emory.uucp> Sender: andrew@tekecs.TEK.COM Organization: Tektronix, Wilsonville, Oregon Lines: 18 [] "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@relay.cs.net) [ARPA]