From: "David" Newsgroups: comp.os.msdos.djgpp References: <44An5.13355$Gs DOT 66133 AT news4 DOT atl> <7QWn5.142399$Fw6 DOT 3484407 AT afrodite DOT telenet-ops DOT be> <5567-Mon21Aug2000143151+0300-eliz AT is DOT elta DOT co DOT il> <8o2l25$5rr$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> Subject: Re: DJGPP port of WHICH Lines: 33 X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Thu, 24 Aug 2000 08:25:00 -0400 NNTP-Posting-Host: 209.214.201.87 X-Trace: news1.atl 967119974 209.214.201.87 (Thu, 24 Aug 2000 08:26:14 EDT) NNTP-Posting-Date: Thu, 24 Aug 2000 08:26:14 EDT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hans-Bernhard Broeker wrote in message news:8o2l25$5rr$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE... > David wrote: > > I played around with the __dosexec_find_on_path function, but it > > would require major changes to the original "which.c" source code > > to support the "-a" switch. > > Traditional Unix 'which' does not have a '-a' option, neither in the > csh builtin of that name, nor in the standalone tool. To get the > effect of 'which -a' on Unix, you're supposed to use another command, > called 'where'. The only case where 'which -a' exists is if you alias > 'which' by 'type -p' in a Bourne-style shell, or (maybe, didn't check) > in GNU which. > Unfortunately, ftp://prep.ai.mit.edu/pub/gnu/ only has the sources for which, so that's what I modified. > > The "-a" switch is the reason I wanted to use "which" to begin with, > > as I have 3 different versions of grep on my system, and I like to > > be able to check which one I will be calling. > > You don't need '-a' to do that. 'which grep' will tell you exactly the > version of grep you'll be using, and nothing else. That's how the tool > came to its name. 'which -a' is for when you want to know what > alternative versions of a command there are. What I really wanted to was find all the versions of various utilities with identical names (like grep, masm, cl, gcc, etc.) on my machine and find how I needed to change my path to call the right one.