Mail Archives: djgpp/2000/08/24/05:41:47
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 -