[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: find . -wholename ’./src/emacs’ - prune -o -print
From: |
James Youngman |
Subject: |
Re: find . -wholename ’./src/emacs’ - prune -o -print |
Date: |
Thu, 25 Feb 2010 11:09:45 +0000 |
On Thu, Feb 25, 2010 at 10:42 AM, James Youngman <address@hidden> wrote:
> On Thu, Feb 25, 2010 at 5:29 AM, Reza Roboubi <address@hidden> wrote:
>> find . -wholename './src/emacs/' -prune -o -print (extra slash)
>>
>> and that wasn't working. Why is that?
>
> Because path names examined by find never include a trailing slash.
>
> Similarly "find -name a/b" will never find anything, since -name only
> works with files' base names (i.e. with the directory part removed)
> and so they never include a slash.
>
> The manpage should probably point out both facts.
The manpage already points this out for -path (and hence -wholename):
Find compares the -path argument with the concatenation of a
directory name and the base name of the file it’s examining.
Since the concatenation will never end with a slash, -path argu‐
ments ending in a slash will match nothing (except perhaps a
start point specified on the command line).
I just pushed the attached patch to deal with -name better.
James.
0001-Explain-the-problems-with-name-a-b-and-path-foo.patch
Description: Text Data