Subject: Re: bin/19354: Semantics of /bin/sh "command" builtin violates POSIX
To: None <netbsd-bugs@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: netbsd-bugs
Date: 12/17/2002 13:22:39
On Wed, Dec 11, 2002 at 08:27:11PM +0000, David Laight wrote:
> > >Synopsis:       Semantics of /bin/sh "command" builtin violates POSIX
> > 	
> > 	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.
> 
> I'll sort out a fix...
> I didn't ever read the 'command' man page while doing my
> recent batch of fixes to /bin/sh.

This opened another bag of worms...
try (if I've typed it correctly):

$ echo '#!/bin/echo ls' >/tmp/ls
$ chmod +x /tmp/ls
$ PATH=/x:/bin
$ ls
<listing of current directory>
$ PATH=/bin:/tmp ls
ls /tmp/ls
$ PATH=/bin:/tmp ls
<listing of current directory>
$

The pre-vfork (eg netbsd 1.5.1) sh is differemtly broken in the
same area.

	David

-- 
David Laight: david@l8s.co.uk