Subject: standards/11203: POSIX.2: "command" in sh(1) does the wrong thing
To: None <gnats-bugs@gnats.netbsd.org>
From: Ben Harris <bjh21@cam.ac.uk>
List: netbsd-bugs
Date: 10/12/2000 13:58:25
>Number:         11203
>Category:       standards
>Synopsis:       POSIX.2: "command" in sh(1) does the wrong thing
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 12 13:58:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Ben Harris
>Release:        2000-02-07
>Organization:
>Environment:
NetBSD cromarty 1.4X NetBSD 1.4X (CROMARTY) #9: Wed May  3 23:49:51 BST 2000
     bjh21@cromarty:/usr/src/sys/arch/macppc/compile/CROMARTY macppc
>Description:
According to POSIX.2-1992, "command foo" should behave exactly the same as
"foo" unless "foo" is an option (see below), a special builtin or a shell
function.  Under NetBSD, though, this only seems to work for regular
builtins.

Also, according to POSIX.2, "command -p foo" should search for "foo" on
the standard PATH, and if we support POSIX2_UPE, "command -v foo" and
"command -V foo" should explain briefly and verbosely where the shell will
find "foo".  None of these options works.

>How-To-Repeat:
$ export PATH=`getconf PATH`
$ command cat
cat: not found
$ command -p cat
-p: not found
$ command -v cat
-v: not found
$ command -V cat
-V: not found

>Fix:

-- 
Ben Harris
Unix Support, University of Cambridge Computing Service.

>Release-Note:
>Audit-Trail:
>Unformatted: