Subject: Re: Shell behaviour regarding PATH
To: None <tech-userlevel@netbsd.org>
From: Greg A. Woods <woods@most.weird.com>
List: tech-userlevel
Date: 02/11/2000 10:05:19
[ On Friday, February 11, 2000 at 02:12:35 (-0800), Todd Whitesel wrote: ]
> Subject: Re: Shell behaviour regarding PATH
>
> Argh, I am sorry to perpetuate this thread, but I really have to place
> a vote in favor of the historical behavior. I don't think it's an error.
> 
> It is how you implement a command line that accepts either commands or
> pathnames to programs, with no ambiguity between the two unless you
> deliberately add "." to your PATH.

Not to go on too long, but yes, I agree 100%!  :-)

In fact I was quite surprised after thinking things through in this
context that "." was in fact a part of the default search path for the
Plan 9 "rc" shell.  I fully expected it to be just "/bin" until I read
to the bottom of the manual page this time.  I guess old habits die
hard!  :-)

I've almost given up on putting "." (or rather an empty sub-field) in my
$PATH on Unix too, and I've been recommending the same to new users of
Unix that I've been helping too.  I find they have a much deeper
understanding of $PATH and relative pathnames if they learn to always
use "./foo" when they mean to run something locally.  It also saves from
having to explain to them why "test" won't run their local "test"
program -- they figure that out naturally on their own if they
understand the basics and knowing that they figured this out on their
own is even more important to their learning.

-- 
							Greg A. Woods

+1 416 218-0098      VE3TCP      <gwoods@acm.org>      <robohack!woods>
Planix, Inc. <woods@planix.com>; Secrets of the Weird <woods@weird.com>