Subject: bin/19354: Semantics of /bin/sh "command" builtin violates POSIX
To: None <gnats-bugs@gnats.netbsd.org>
From: Christopher Richards <richards+netbsd@CS.Princeton.EDU>
List: netbsd-bugs
Date: 12/11/2002 14:35:10
>Number: 19354
>Category: bin
>Synopsis: Semantics of /bin/sh "command" builtin violates POSIX
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 11 11:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Christopher Richards
>Release: NetBSD 1.6_STABLE
>Organization:
>Environment:
System: NetBSD zembla.Princeton.EDU 1.6_STABLE NetBSD 1.6_STABLE (ZEMBLA) #16: Mon Dec 2 21:44:56 EST 2002 richards@zembla.Princeton.EDU:/home/richards/x/src/kern i386
Architecture: i386
Machine: i386
>Description:
The current semantics of "command" require a shell builtin
to be given. As per POSIX and /bin/ksh, "command" should merely
suppresses shell function lookup.
Also, the "-p" option to "command" is missing.
See
<http://www.opengroup.org/onlinepubs/007904975/utilities/command.html>
for a full description of how "command" should behave. Or,
just copy what /bin/ksh does.
>How-To-Repeat:
$ /bin/sh -c "date () { echo "foo"; }; command date"
date: not found
$ /bin/sh -c "date () { echo "foo"; }; PATH='' command -p date"
-p: not found
$ /bin/ksh -c "date () { echo "foo"; }; command date"
Wed Dec 11 14:31:04 EST 2002
$ /bin/ksh -c "date () { echo "foo"; }; PATH='' command -p date"
Wed Dec 11 14:32:44 EST 2002
>Fix:
Not supplied.
>Release-Note:
>Audit-Trail:
>Unformatted: