From: Ray Andrews <rayandrews@eastlink.ca>
To: zsh-users@zsh.org
Subject: Re: whence (was Re: local unfunction)
Date: Sat, 31 Mar 2018 21:29:52 -0700 [thread overview]
Message-ID: <4fd81a57-30af-2e07-3be5-076826cce844@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7ane3_cT75hyZYp_4Zd1aT1eeDbbW9CVpBTZjAhKFQ+Qw@mail.gmail.com>
On 31/03/18 06:18 PM, Bart Schaefer wrote:
>
> What's with the extra ":" there? Is there actually a colon in the file name?
It's deliberate abuse, I tried all sorts of things to see what might
work and what might break. It seems there's nothing in my issues
that's directly caused by some sort of weird naming .
> -m # find all matches of a pattern, subsumes '-a' (executable ONLY unless
I meant it might be so not that it is so.
> This being a proposed new flag. I think this points to the source of
> the confusion. The command hash table will contain the first
> occurrence of every file name from every directory in $path, even if
> that first occurrence is not executable, and "whence -m" will show you
> all of the matching entries in the hash table. The existing -m option
> subsumes your -t.
>
> The other confusion is that -m never searches $path. It always
> populates the command hash table if necessary and then searches the
> hash table.
I dunno Bart, it all seems so counter intuitive. Maybe it's just me,
but my 'interpretation' seems the natural one. It seems absolutely
robust as far as aliases and functions and everything but files, but
with files, one never knows what might be found. At the very least the
docs could be a bit more clear. But as I said, I seem to be the only
one chaffing about this so I'll use other means to find matching files
on the path and make a clear distinction between executables and non
executables. The output of my wrapper, unverbose, looks like this:
$ i "zsh*"
146:: (1)TYPE: /aWorking/Zsh/Source/Wk/zsh is an unexecutable script or
text file
146:: (2)TYPE: /aWorking/Zsh/System/zsh is an unexecutable script or
text file
146:: (3)TYPE: /aWorking/Bin/zsh5.3.txt is an unexecutable script or
text file
196:: (1)TYPE: zsh is /usr/local/bin/zsh -> /aWorking/Bin/zsh5.3:
196:: (2)TYPE: zsh is /usr/bin/zsh -> /aWorking/Bin/zsh5.3:
196:: (3)TYPE: zsh is /bin/zsh -> /aWorking/Bin/zsh5.3:
... it finds every damn thing every time no buts or maybes and I'm
expecting it to work in April too except when the moon is waning ;-)
$ i grep
196:: (1)TYPE: GREP is an alias for grep $g_nocase --color=auto:
196:: (2)TYPE: grep is /bin/grep:
$ i echo
196:: (1)TYPE: echo is a shell builtin:
196:: (2)TYPE: echo is /bin/echo:
next prev parent reply other threads:[~2018-04-01 4:30 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 [this message]
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
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=4fd81a57-30af-2e07-3be5-076826cce844@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).