Bug 10250 - RHL 6.1 "which" command and man page are dangerously erroneous.
RHL 6.1 "which" command and man page are dangerously erroneous.
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: which (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Preston Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-03-19 15:14 EST by swear
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-05-14 16:48:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description swear 2000-03-19 15:14:23 EST
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 16:48:59 EDT
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.