zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: whence (was Re: local unfunction)
Date: Wed, 4 Apr 2018 17:20:27 -0700	[thread overview]
Message-ID: <CAH+w=7a=5F31DYVdXH5HRJVS7V_BYCkJihznYo2TFhBMVX+BFA@mail.gmail.com> (raw)
In-Reply-To: <20180404181017.lcz74c4tyojz77ao@tarpaulin.shahaf.local2>

On Wed, Apr 4, 2018 at 11:10 AM, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> Let me rephrase.  In your example:
>
>> > > % path=(./Src $path)
>> > > % whence zsh
>> > > ./Src/zsh
>> > > % whence -a zsh
>> > > ./Src/zsh
>> > > /bin/zsh
>> > > % whence -m zsh
>> > > /bin/zsh
>> > > %
>
> why do 'whence' and 'whence -m' give different results?  Isn't one or the other
> wrong?

It could be argued that "whence -m" is inaccurate, yes, but that's
because "." and other relative locations in $PATH are weird, not
because the command hash table is out of date.

It's important to note that "whence -m" is doing pattern matching on
strings, not filename generation.  It's not meant to search for files
in $PATH, it's meant to do "hash -m ..." for all possible
command-position hash tables in one go.  Most of what else it does, it
does because somebody complained that every line of output wasn't
uniformly formatted.


  reply	other threads:[~2018-04-05  0:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31 15:25 Bart Schaefer
2018-03-31 17:21 ` Ray Andrews
2018-04-01  1:18   ` Bart Schaefer
2018-04-01  4:29     ` Ray Andrews
2018-04-01 17:33     ` Daniel Shahaf
2018-04-01 18:17       ` Bart Schaefer
2018-04-04 18:10         ` Daniel Shahaf
2018-04-05  0:20           ` Bart Schaefer [this message]
2018-04-05  1:41             ` Ray Andrews
2018-04-05  5:08               ` Bart Schaefer
2018-04-05 14:28                 ` Ray Andrews

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='CAH+w=7a=5F31DYVdXH5HRJVS7V_BYCkJihznYo2TFhBMVX+BFA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=d.s@daniel.shahaf.name \
    --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).