Aha.
As others pointed out, /usr/ucb/which is actually a c shell script. And
the first thing it does it suck in .cshrc from your home directory.
Dare I guess that this file exists, and sets the path?
Having which implemented that way do have some potential traps and
issues, such as this one...
Johnny
On 2019-05-25 00:02, Jon Brase wrote:
>
> How did you come to that conclusion?
>
>
> If I run (in sh):
>
> |
> PATH=
> exportPATH
> /usr/ucb/which sh
> |
>
> I get
>
> |
> /bin/sh
> |
>
> Likewise for other commands.
>
> If I then run which for something that doesn't exist on the system, e.g,
>
> |
> /usr/ucb/which sudo
> |
>
> I get:
>
> |
> nosudo in/bin /sbin /etc /usr/sbin /usr/ucb /usr/bin /usr/new/usr/local
> |
>
> And, in fact, if I add a directory to $PATH that isn't in the above
> list, which still fails to find executables in that directory.
>
> Now, when I run tcsh, then it uses the shell builtin which, which
> behaves as documented, searching only and exactly the folders specified
> in $PATH.
>
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
pidp-11+u...@googlegroups.com
> <mailto:
pidp-11+u...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/pidp-11/9f5c5c4c-2f76-435d-aa3e-d82a3145f024%40googlegroups.com
> <
https://groups.google.com/d/msgid/pidp-11/9f5c5c4c-2f76-435d-aa3e-d82a3145f024%40googlegroups.com?utm_medium=email&utm_source=footer>.