delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/24/05:41:47

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DJGPP port of WHICH
Date: 24 Aug 2000 08:06:29 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 24
Message-ID: <8o2l25$5rr$1@nets3.rz.RWTH-Aachen.DE>
References: <44An5.13355$Gs DOT 66133 AT news4 DOT atl> <7QWn5.142399$Fw6 DOT 3484407 AT afrodite DOT telenet-ops DOT be> <jz7o5.1187$Mw DOT 11451 AT news2 DOT atl> <5567-Mon21Aug2000143151+0300-eliz AT is DOT elta DOT co DOT il> <Y13p5.7909$Ez6 DOT 48830 AT news3 DOT atl>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 967104389 6011 137.226.32.75 (24 Aug 2000 08:06:29 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 24 Aug 2000 08:06:29 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

David <nobody AT bogus DOT org> 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.

> 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.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019