zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: 'whence' anomaly.
Date: Mon, 24 Mar 2014 20:10:40 -0700	[thread overview]
Message-ID: <5330F3B0.7030704@eastlink.ca> (raw)
In-Reply-To: <140324154811.ZM4815@torch.brasslantern.com>

On 03/24/2014 03:48 PM, Bart Schaefer wrote:
> On Mar 24, 11:19am, Ray Andrews wrote:
> }
> } What causes this:
> }
> } >     $ whence -m mplayer
> } >
> } >     $ whence mplayer
> } >     /usr/bin/mplayer
> } >
> } >     $ whence -m mplayer
> } >     /usr/bin/mplayer
>
> I guess you could think of it as both/either a bug and/or a feature ...
>
> "whence -m" searches, but does not populate, the command hash table.
> Thus if the NO_HASH_CMDS option is set, "whence -m" does not work
> at all. [*]
>
> "whence" populates the hash table as a side-effect of searching $PATH,
> presuming HASH_CMDS is set; but it might not fully populate the table
> if HASH_DIRS is set, so "whence -m" of a different command from later
> in the $PATH might still fail.
>
> [*] Except that the CORRECT option also relies on the hash table, so
> if that is set, as soon as anything might need correcting, the table
> gets filled, and "whence -m" will start working again.
>
Yikes, more ifs buts and maybes. Is there some way to get a reliable 
result? AFAICT, none of the
options you mention are set here (that's from scanning the output of  " 
$ set "). Should I always make a
double call?: " $ whence mplayer; whence -m "mplayer" ? Set some option?


  reply	other threads:[~2014-03-25  3:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-24 14:43 Segregating a Global Alias zzapper
2014-03-24 17:22 ` Bart Schaefer
2014-03-24 17:34   ` zzapper
2014-03-24 17:47     ` zzapper
2014-03-24 18:04       ` Re[2]: " Manuel Presnitz
2014-03-25 12:28         ` zzapper
2014-03-24 18:11       ` Paul Johnson
2014-03-24 18:19       ` 'whence' anomaly Ray Andrews
2014-03-24 22:48         ` Bart Schaefer
2014-03-25  3:10           ` Ray Andrews [this message]
2014-03-25  6:25             ` Bart Schaefer
2014-03-25 15:32               ` Ray Andrews
2014-03-24 22:36       ` Segregating a Global Alias Bart Schaefer
2014-03-25  1:56         ` Bart Schaefer
2014-03-25 14:07           ` zzapper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5330F3B0.7030704@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).