Hi Steffen,

> >     $ >/tmp/foo
> >     $ PATH=/tmp:$PATH bash -c 'command -v foo'
> >     /tmp/foo
> >     $ >/tmp/ls
> >     $ PATH=/tmp:$PATH bash -c 'command -v ls'
> >     /usr/bin/ls
>
> Boo-ho!!  To me this looks like a bug in bash and dash

No.  My command(1p) says

    -v  Write a string to standard output that indicates the pathname
        or command that will be used by the shell, in the current

and it's true;  the pathname is used by the shell.

    $ ls -l /tmp/foo
    -rw-r--r-- 1 ralph ralph 14 Sep  4 13:47 /tmp/foo
    $ PATH=/tmp:$PATH bash -c foo
    bash: /tmp/foo: Permission denied

autoconf's ./configure here does

    test -f "$1" && test -x "$1"

rather than command(1).

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy

Reply via email to