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

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

On 2022-10-31 07:36, Roman Perepelitsa wrote:
I did prepend dot to PATH. You can see the full listing of commands in
my first reply.

Yeah I noticed but I think our situations are different.  I'll bet you can duplicate my output if you tinker with your path. Sheesh, what else could it be?  Anyway that's a small matter, what's bugging me is the way whence doesn't show everything if the dot is not expanded.  Right now I'm doing this hack:

ppath=( $( realpath -s $path ) )                            # realpath needs spaces between dirs. PATH=$( echo $ppath | sed -r "s/ /:/g" )                    # put the colons back
all_matches=( ${(f)"$( whence -mavS (#i)$1 )"} )    # fire up whence
PATH=$oldpath         # restore PATH

... and I end up with 'everything' being found in the current directory.  Pretty horrible tho.  Dunno, what could I have done to make that necessary?  Seems to me whence simply doesn't look for files in a 'dot' directory.  Why else would expanding it change the output?  How could that be my breaking something?  Mind, I can break anything.

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