On Wed, May 21 2014, David Bremner <da...@tethera.net> wrote:

> Tomi Ollila <tomi.oll...@iki.fi> writes:
>>
>> hash is builtin in modern shells, and is command in some systems
>> which(1) is builtin in zsh (only?). Solaris 10 which(1) exits 0
>> even the command is not found.
>>
>> Tomi
>
> I thought "command -v" was the posix way of testing for a binary?


Ok, I wrote quite a few lines why hash instead of command -v,
just to finally notice this:

$ dash -c 'hash zapdsb || echo foo'
dash: 1: hash: zapdsb : not found
foo

which is ok... but:

$ ksh -c 'hash zapdsb || echo foo'
$ mksh -c 'hash zapdsb || echo foo'

Wat! hash in these shells do not exit nonzero -- so good with my which(1)
rant >;/

So I change my preference totally -- `command -v` instead of `hash` -- we
have to fix the current uses of `hash` too...


> d


Tomi
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to