ugh.book

(singke) #1

166 csh, pipes, and find


po>

Hey, now the files are there! Just have to remember to cd to random
directories in order to get find to find things in them. What a crock of
Unix.

Poor Halstead must have the entry for his home directory in /etc/passwd
pointing off to some symlink that points to his real directory, so some com-
mands work for him and some don’t.
Why not modify find to make it follow symlinks? Because then any sym-
link that pointed to a directory higher up the tree would throw find into an
endless loop. It would take careful forethought and real programming to
design a system that didn’t scan endlessly over the same directory time
after time. The simple, Unix, copout solution is just not to follow symlinks,
and force the users to deal with the result.

As networked systems become more and more complicated, these prob-
lems are becoming harder and harder:
Date: Wed, 2 Jan 1991 16:14:27 PST
From: Ken Harrenstien <[email protected]>
Subject: Why find doesn’t find anything
To: UNIX-HATERS

I just figured out why the “find” program isn’t working for me any-
more.

Even though the syntax is rather clumsy and gross, I have relied on it
for a long time to avoid spending hours fruitlessly wandering up and
down byzantine directory hierarchies in search of the source for a
program that I know exists somewhere (a different place on each
machine, of course).

It turns out that in this brave new world of NFS and symbolic links,
“find” is becoming worthless. The so-called file system we have here
is a grand spaghetti pile combining several different fileservers with
lots and lots of symbolic links hither and thither, none of which the
program bothers to follow up on. There isn’t even a switch to request
this... the net effect is that enormous chunks of the search space are
silently excluded. I finally realized this when my request to search a
fairly sizeable directory turned up nothing (not entirely surprising,
but it did nothing too fast) and investigation finally revealed that the
directory was a symbolic link to some other place.
Free download pdf