Bug 10250 - RHL 6.1 "which" command and man page are dangerously erroneous.
Summary: RHL 6.1 "which" command and man page are dangerously erroneous.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: which
Version: 6.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Preston Brown
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-03-19 20:14 UTC by swear
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-05-14 20:48:10 UTC
Embargoed:


Attachments (Terms of Use)

Description swear 2000-03-19 20:14:23 UTC
The man page says "it prints to stdout the full path of the executables
that would have been executed when [SHOULD BE "if"] this argument had
been entered at the shell prompt". But if "kill" is entered at the bash
shell prompt, the reported "/bin/kill" will NOT be executed, because
bash will run it's own kill command which has different options.

Either the command or the man page is wrong.  If the command can't be
changed, then the man page should provide warning in both the
"Description" and the "Bugs" sections.

Comment 1 Jeff Johnson 2000-05-14 20:48:59 UTC
The nuance of difference between "if" and "when" is carefully noted, but
hardly seems to be a crucial point.

Reading further in the man page shows how to use
    alias which='alias | which --tty-only --read-alias --show-tilde --show-dot'
in order to detect (at least) aliased commands, and a little thought should
provide a mechanism for detecting builtins as well, if that's your pleasure.
Meanwhile, the existing which(1) is superior to the traditional implementation
of which in a csh script, and the behavior is dictated more by conformance with
tradition than logic.


Note You need to log in before you can comment on or make changes to this bug.