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> <8o34n7$cvu$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 12:43:50 -0400 NNTP-Posting-Host: 209.214.200.149 X-Trace: news2.atl 967135503 209.214.200.149 (Thu, 24 Aug 2000 12:45:03 EDT) NNTP-Posting-Date: Thu, 24 Aug 2000 12:45:03 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:8o34n7$cvu$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE... > David wrote: > > Hans-Bernhard Broeker wrote in message > > news:8o2l25$5rr$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE... > [...] > >> 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. > > Changing the PATH generally won't help, in that respect. No matter how > you set it, you'll almost invariably have the wrong version of some > program found first. > > If you need a particular set of utilities, you'll either have to > modify your path dynamically (like: remove DJGPP from the PATH, and > add Borland C++ instead of it, when you switch from one to the other), > or set up a global "what I want executed" directory with links to the > actual programs in it, and put that first in the path. Thats exactly what I do. If I get unexplained behavior during a make, I try to rearrange my path using batch files. The WHICH utility is a convenience, and the "-a" option is an extra convenience.