Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: whence output varies with dot vs. realpath in $PATH



On Mon, Oct 31, 2022 at 5:03 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> as to '-a' and '-m' they sure don't get along. I have a few examples
> where they seem to try to cancel each other.  Seems to me that -m is an
> expansion of -a

No.  -m means to find all the names (in any hash table) that match a
pattern.  -a means to show all the occurrences in $path of each name
(either literally without -m, or found in the command hash table by
-m).  -m happens first, and then -a searches the path.

> BTW, you know what would be sweet, is if: "rap is a shell function from
> rap" ... if there was the option of having that displayed with full
> path.

Whether a full path appears there depends on how the function was
defined.  The only way you get the output with "... from ..." but
without the full path is if you source the function from a file in the
current directory (e.g., "source rap").  Even autoloading the function
with "fpath=(.); autoload rap; rap" gets you the full path.




Messages sorted by: Reverse Date, Date, Thread, Author