From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: 'whence' question
Date: Thu, 6 Nov 2014 13:53:00 -0800 [thread overview]
Message-ID: <CAH+w=7b6kFCPnxJkJRvFqKCQPrK6xv8Avr2LOU5jb-jvsVYpWg@mail.gmail.com> (raw)
In-Reply-To: <545BEC0F.8080805@eastlink.ca>
[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]
On Thu, Nov 6, 2014 at 1:45 PM, Ray Andrews <rayandrews@eastlink.ca> wrote:
> On 11/05/2014 08:43 PM, Bart Schaefer wrote:
>
>> The pattern accepted by the -m option is not a glob,
>>
>
> That seems very counterintuitive! I'm taking it as a regular glob just
> as, I think,
> anyone would.
>
A "regular glob" and a pattern aren't significantly different, but for
example you can't use (most) glob qualifiers in a pattern, and the meaning
of "/" is very different. Note that "whence" is not a file search tool;
scanning a hash table of alias names with a glob comparing file type or
modification time would make no sense.
Having just written that, it occurs to me that perhaps the "right way"
>> is the equivalent of this? --
>>
>> whence -a ${(k)commands[(I)pattern]}
>>
> I couldn't get any love from that.
Interesting, it worked very nicely for me even as far back as zsh-4.2.6 on
an ancient virtual machine:
% whence -vsa ${(k)commands[(I)zsh*]}
zshenv not found
zsh is an alias for zsh-4.2.6
zsh is /usr/local/bin/zsh -> /bin/zsh
zsh is /bin/zsh
zsh.old is /bin/zsh.old
zshrc not found
zsh-4.2.0 is /bin/zsh-4.2.0
zsh-4.2.3 is /bin/zsh-4.2.3
zsh-4.2.5 is /bin/zsh-4.2.5
zsh-4.2.6 is /bin/zsh-4.2.6
That should find all the names in the command hash table that begin with
zsh, and then pass them all to whence to find the full paths. I'm not sure
why zshrc and zshenv are in the command hash table.
next prev parent reply other threads:[~2014-11-06 21:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-05 18:33 Ray Andrews
2014-11-05 17:49 ` Oliver Kiddle
2014-11-05 18:00 ` Peter Stephenson
2014-11-06 4:43 ` Bart Schaefer
2014-11-06 21:45 ` Ray Andrews
2014-11-06 21:53 ` Bart Schaefer [this message]
2014-11-06 23:15 ` Ray Andrews
2014-11-06 22:54 ` Bart Schaefer
2014-11-05 19:15 ` Ray Andrews
2014-11-05 17:50 ` Peter Stephenson
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=7b6kFCPnxJkJRvFqKCQPrK6xv8Avr2LOU5jb-jvsVYpWg@mail.gmail.com' \
--to=schaefer@brasslantern.com \
--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).