zsh-users
 help / color / mirror / code / Atom feed
* whence output varies with dot vs. realpath in $PATH
@ 2022-10-31 13:30 Ray Andrews
  2022-10-31 13:43 ` Roman Perepelitsa
  0 siblings, 1 reply; 20+ messages in thread
From: Ray Andrews @ 2022-10-31 13:30 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 2119 bytes --]

Trying to get whence to be both case insensitive and accepting of 
patterns I noticed something interesting.  The first item in my $PATH is 
the dot, I take this as not unusual because one might want to execute 
some command found in the current directory. Anyway:

    0 /aWorking/Zsh/Source/Wk 1 $ whence -mavS "(#i)*rap"

    RAP is an alias for echo howdy
    _trap is an autoload shell function
    rap is a shell function from rap
    trap is a shell builtin
    bwrap is /usr/bin/bwrap
    select-default-iwrap is /usr/bin/select-default-iwrap

... I have a whole load of various absurdly named test files in the 
current directory but whence doesn't find them.  However if I modify my 
PATH to make the dot expand to the ( do we say 'canonical' ? ) ... the 
actual name of the current directory:

    0 /aWorking/Zsh/Source/Wk 1 $ vared PATH
    /aWorking/Zsh/Source/Wk:/aWorking/Zsh/System:/aWorking/Bin:/usr/local/bin:/usr/sbin:/usr/bin:

... everything is found:

0 /aWorking/Zsh/Source/Wk 1 $ whence -mavS "(#i)*rap"

    RAP is an alias for echo howdy
    _trap is an autoload shell function
    rap is a shell function from rap
    trap is a shell builtin
    RAP is /aWorking/Zsh/Source/Wk/RAP
    RAP is RAP
    RAp is /aWorking/Zsh/Source/Wk/RAp
    RAp is RAp
    RaP is /aWorking/Zsh/Source/Wk/RaP -> /aWorking/Zsh/Source/Wk/RAP
    RaP is RaP
    bwrap is /usr/bin/bwrap
    rAp is /aWorking/Zsh/Source/Wk/rAp
    rAp is rAp
    select-default-iwrap is /usr/bin/select-default-iwrap

... all my silly files show up, infact they show up twice.  The eg: "RAP 
is RAP" doesn't seem to say very much when we already have: "RAP is 
/aWorking/Zsh/Source/Wk/RAP"

We can even get three restatements:


     2 /aWorking/Zsh/Source/Wk 0 $ /bin

     2 /bin 0 $ whence -mavS "zsh"

     zsh is ./zsh
     zsh is /usr/bin/zsh
     zsh is zsh

... again the last line doesn't seem very useful.  The first is of 
course true and the second line seems to highlight the fact that in 
Debian '/bin' is a link to '/usr/bin'.

Thoughts? Can I have the full output while leaving the dot in my path?

[-- Attachment #2: Type: text/html, Size: 2872 bytes --]

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2022-11-01  1:15 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 13:30 whence output varies with dot vs. realpath in $PATH Ray Andrews
2022-10-31 13:43 ` Roman Perepelitsa
2022-10-31 14:06   ` Ray Andrews
2022-10-31 14:10     ` Roman Perepelitsa
2022-10-31 14:32       ` Ray Andrews
2022-10-31 14:36         ` Roman Perepelitsa
2022-10-31 14:57           ` Ray Andrews
2022-10-31 21:18             ` Bart Schaefer
2022-10-31 22:26               ` Bart Schaefer
2022-10-31 22:59               ` Ray Andrews
2022-10-31 23:03                 ` Bart Schaefer
2022-10-31 23:17                   ` Ray Andrews
2022-10-31 23:21                     ` Bart Schaefer
2022-10-31 23:14                 ` Lawrence Velázquez
2022-10-31 23:21                   ` Ray Andrews
2022-10-31 23:38                     ` Bart Schaefer
2022-11-01  0:03                       ` Ray Andrews
2022-11-01  0:31                         ` Bart Schaefer
2022-11-01  0:55                           ` Ray Andrews
2022-11-01  1:08                             ` Bart Schaefer

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).