🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #531

Re: What is my name?

#531
From: Mike (I'll think of something ye...
Date: Wed, 19 Jul 1989 08:47
24 lines
1546 bytes
In article <1227@atanasoff.cs.iastate.edu> jwright@atanasoff.cs.iastate.edu.UUCP (Jim Wright) writes:
<In article <20565@cup.portal.com> thad@cup.portal.com (Thad P Floryan) writes:
<| 
<| It would be trivial to adapt "which" to match the first occurrence
<| of */argv[0] in the PATH searched by "which".
<
<Wouldn't this fail if, for example, I had a script file in S: which
<then explicitly called the program and the program was not in a directory
<on the PATH.

No, it won't. If the program is invoked explicitly, then argv[0]
should contain a ':', so the path is never searched. That's why you
have to adapt the code, instead of dropping it in as is.

Which, of course, doesn't check argv[0], so it will find the script -
which is what you want it to do.

	<mike

--
Come all you rolling minstrels,				Mike Meyer
And together we will try,				mwm@berkeley.edu
To rouse the spirit of the air,				ucbvax!mwm
And move the rolling sky.				mwm@ucbjade.BITNET
Technical Details
Message-ID: <26459@agate.BERKELEY.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwm
References: <26385@agate.BERKELEY.EDU> <20565@cup.portal.com> <1227@atanasoff.cs.iastate.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwm
From: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer)
Newsgroups: comp.sys.amiga.tech
Subject: Re: What is my name?
Message-ID: <26459@agate.BERKELEY.EDU>
Date: 19 Jul 89 08:47:44 GMT
References: <26385@agate.BERKELEY.EDU> <20565@cup.portal.com> <1227@atanasoff.cs.iastate.edu>
Sender: usenet@agate.BERKELEY.EDU
Reply-To: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer)
Organization: Missionaria Phonibalonica
Lines: 24