Subject: Re: CVS commit: src/usr.bin/find
To: None <>
From: Christos Zoulas <>
List: source-changes
Date: 10/21/2005 14:26:57
In article <>, Elad Efrat  <> wrote:
>Zafer Aydogan wrote:
>> I discovered it writing a shell skript for
>> NetBSD.
>That does what? send PRs?
>> I discovered that find was working with double slashes.
>I'm sure many people "discovered" it before you did.
>> I checked
>> Linux, FreeBSD and Solaris where this Problem does not accur. 

I don't see that:

# uname -a
Linux xxx 2.6.11-ts6 #10 SMP Wed Aug 17 20:22:03 GMT 2005 i686 athlon i386 GNU/Linux
# find //bin/// | tail -1

# uname -a
SunOS xxx 5.8 Generic_117350-05 sun4u sparc SUNW,Sun-Fire-V210
# find //bin/// | tail -1

I think that canonicalizing the paths in find is expensive and it is 
wrong to do it by default. If you want canonicalized paths, this should be
done via a find option or in a separate program. Finally the level of
canonicalization is also questionable: Do you want find to return a physical
canonicalized path, or a logical one? I.e. if you do:

    find /usr/old//foo

and /usr/old -> /net/storage/old do you want find to print "/usr/old/foo"
or "/net/storage/old/foo"? And of course this situation is trickier if you
try to logically canonicalize /usr/old/../foo.