Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Is "command" working right, yet?



Op 28-09-16 om 11:30 schreef Peter Stephenson:
> On Tue, 27 Sep 2016 13:15:23 +0100
> Martijn Dekker <martijn@xxxxxxxx> wrote:
>> > 'command -p' means: ignore the PATH environment variable and do the
>> > search as normal, but (if it's a path search) use the system default
>> > path as output by the 'getconf PATH' command. That means the -p option
>> > has no effect for builtins.
> OK, I think that means you want something like the following, where
> command -p in combination with -v or -V uses the default path to do the
> search and print the result.

Nearly. The options combine now, but builtins don't take precedence. As
explained above, I'd expect "command -pv echo" to output simply "echo"
and not "/bin/echo", because it's a builtin. Also 'command -pv :' should
output ':'.

Ref.:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/command.html#tag_20_22
(note: the wordage under -p, "Perform the command search using a default
value for PATH [...]", does not mean "make it a path search even if
there's a matching builtin"; it just means "ignore $PATH and use the
system default path instead, if applicable".)

Thanks,

- M.



Messages sorted by: Reverse Date, Date, Thread, Author