Subject: bin/19354: Semantics of /bin/sh "command" builtin violates POSIX
To: None <>
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
>Originator:     Christopher Richards
>Release:        NetBSD 1.6_STABLE
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
	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.

	for a full description of how "command" should behave.  Or,
	just copy what /bin/ksh does.

	$ /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

	Not supplied.