Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: whence (was Re: local unfunction)
- X-seq: zsh-users 23306
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: whence (was Re: local unfunction)
- Date: Wed, 4 Apr 2018 17:20:27 -0700
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=sIFlCUQWmVcNEgnEPWsrIyHeGZUMA6pAoRavrATUF8k=; b=fBXAZ5BoNcl/xuoEO8m/oVhNQ3H+QlGd9kn7qGubOJvqHEhnb7TACDMpLXYu4XcKDj mpEhPYS/KfdkUT50Y5uaWguJser6mtYkVNVDXWIBXQzjjPQ0AL/EaM96GILws2wb/0Y3 YFZvdkmtZtSS643wvCMjt7waLjmexWXW9ABx/s5f65wH7dt71M0Unh3YlaRoIs0XP5Mb fdy5Ys3JhFompJ7c0RDFr0pX5Ncx2ZhLFYWHnzw+2V88Gai1gbi2htsDfzl6HHoXKjT8 vj+Pk8rsrLCJ/RwX4g5Qt4iv9T2uYmDyl+0q6JIsbqqfShuARIQJjmDSpCGZfqWF9oG7 mzsg==
- In-reply-to: <20180404181017.lcz74c4tyojz77ao@tarpaulin.shahaf.local2>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAH+w=7Zz4HMfB_RA5nHr_i_iwKvD=S0QOjcogc0Y0OYSXv0JXw@mail.gmail.com> <6935145d-785f-f2dd-d4f2-e7ea627e2bc3@eastlink.ca> <CAH+w=7ane3_cT75hyZYp_4Zd1aT1eeDbbW9CVpBTZjAhKFQ+Qw@mail.gmail.com> <1522604036.2902094.1322956328.767274EF@webmail.messagingengine.com> <CAH+w=7YL7S-+QQD0-kLEFh=FFgLBSriEyHzbtL9cjqq_9u1U4Q@mail.gmail.com> <20180404181017.lcz74c4tyojz77ao@tarpaulin.shahaf.local2>
On Wed, Apr 4, 2018 at 11:10 AM, Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx> 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.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author