On Wed, Mar 30, 2005, Yedidyah Bar-David wrote about "Re: A second glibc on
Linux ( there's a keren in the darkness )":
> > P.S. I disagree that having the current directory in the path is only the
> > "DOS way". It has always been the Unix way too, and I still like it to
> > this day. I think that many books even recommended (or perhaps even still
> > recommend) that non-root users have a colon starting their path, meaning
> > that the programs in the current directory take preference. This is useful
> > for programmers, but indeed is probably less useful for non-programmers,
> > which is why this practice fell out of favor over the years.
>
> Nadav, of all the things you said until today, this is surely the one I
> least agree with you about.
Like I said, this is perhaps because I learnt Unix twenty years ago (wow,
time flies...), and fashions have changed. I am still used to having almost
the same PATH setting I had 20 years ago...
> Can you show a concrete example of such a book?
Sure. The classic (but a bit long in the tooth...) "The UNIX Programming
Environment" by Kernighan and Pike, first mentions the PATH in page 37,
and gives the following example:
...
PATH=.:/bin:/usr/bin:/usr/games
The syntax is a bit strange: a sequence of directory names separated
by colons. Remember that '.' is the current directory. You can
ommit the '.'; a null component in PATH means the current directory.
...
Note how it's almost obvious a path starts with ".", and your option is
to drop the dot, but leave a null component - he isn't even considering
dropping the extra colon and therefore current directory from the path.
Then, chapter 3 discusses using the shell and creating new commands.
They give on pages 80 and 81 an example of creating a command "nu" and
using it:
...
$ echo 'who | wc -l' >nu
...
$ chmod +x nu
...
$ nu
...
As it stands, nu works only if it's in your current directory
(provided, of course, that the current directory is in your PATH,
which we will assume from now on).
...
See? Kernighan & Pike, the "bible" of Unix, would like the newbies reading
them to have the current directory in their path, and even assume this is
so.
So perhaps this tradition is no longer in vogue, and perhaps there are a
1001 security reasons and other valid reasons to avoid it, but it still is
a generation-old Unix tradition. Not a DOS tradition :)
> Just to give a small "proof" that I am not entirely wrong, in tcsh there
> are two relevant compile-time options - one is to move '.' to the end of
> the path and one is to omit it altogether. So enough people found it
> useful to add to tcsh.
The fact they even had to deal with this "." means that having it was
a common tradition, I think.
> I am also not sure why it's so much more useful for programmers. You do
> not have to add './', right, but you have to add a few chars for tab
> completion to work (because it searches the entire path).
Perhaps. Although if you have a command called "nu", then typing "nu" (2
characters) is definitely faster than "./n<TAB>" (4 characters). Silly
example? I know. Never mind.
I'm not trying to defend the dot in my PATH. It's probably a thing
of the past. I just didn't want it to be called... DOS-like. <shudder> :)
--
Nadav Har'El | Thursday, Mar 31 2005, 20 Adar II 5765
[EMAIL PROTECTED] |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Tourist: Someone who goes 3,000 miles to
http://nadav.harel.org.il |get a picture in front of his car.
=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]