On 5/9/07, Juergen Keil <[EMAIL PROTECTED]> wrote:

Isn't the use of "which" wrong, anyway?

"which" belongs to csh/tcsh, and tells you about csh's/tcsh's idea
about a command or a csh command alias.

IMO, for a /bin/sh (or bash) script, using the "type" command would
be a better idea.

"which" returns the first path, "type" returns all paths.

# type awk
awk is /bin/awk
awk is /usr/bin/awk
# which awk
/bin/awk
# type foo
-bash: type: foo: not found


Either way would work, but even with "type", it still needs to be
"type foo 2>/dev/null".

Thanks,
Jeff.


Reply via email to