Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!mrsvr.UUCP!kohli@gemed.ge.com From: kohli@gemed (Jim Kohli) Newsgroups: comp.unix.questions Subject: Re: How to get the pathname of the current executable? Message-ID: <2052@mrsvr.UUCP> Date: 13 Feb 90 04:09:18 GMT References: <1610.25d028a3@wums.wustl.edu> <1990Feb7.211538.3894@iwarp.intel.com> <5378@buengc.BU.EDU> Sender: news@mrsvr.UUCP Reply-To: kohli@gemed.ge.com (Jim Kohli) Organization: GE Medical, Applied Science Lab Lines: 40 In article <5378@buengc.BU.EDU>, bph@buengc.bu.edu (Blair P. Houghton) writes: merlyn@iwarp.intel.com (Randal Schwartz) writes: <>In article <1610.25d028a3@wums.wustl.edu>, bethge@wums writes: <>[wants to know how to find the name of the current executable] <>| Is there a better (more transparent) way? <> <>No. This was hashed out about a year ago in either c.u.q or c.u.w. <>Basically, it boils down to the fact that you have no idea where you <>came from, and the closest you could come is to count on the shells to <>*mostly* give you the right answer *most* of the time in argv[0]. <>However, programs that do execv() are free to provide *whatever* they <>want. So, you're out of luck, and subject to spoofing. <> <>Just another UNIX hacker, <