[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -iname a -or -iname b -exec: not on all files
From: |
James Youngman |
Subject: |
Re: -iname a -or -iname b -exec: not on all files |
Date: |
Sun, 14 Sep 2008 17:09:29 +0100 |
On Sun, Sep 14, 2008 at 4:31 PM, Carles Pina i Estany <address@hidden> wrote:
>
> Hello,
>
> On Sep/14/2008, James Youngman wrote:
>> On Sun, Sep 14, 2008 at 3:45 PM, Carles Pina i Estany <address@hidden> wrote:
>
>> > If I execute:
>> > find . -type f -iname "*copy*" -or -iname "*changelog*" -exec echo {}
>> > \;|wc -l
>> > Result: 2841
>>
>> Yup, because this is equivalent to
>>
>> find . -type f -iname "*copy*" -or \( -iname "*changelog*" -exec echo {} \)
>
> Curios... this command only prints *changelog* files, not *copy* files.
>
> I would expect (I haven't checked the manual) printing to stdout the
> *copy* files (default behaviour) and execute the -exec echo for the
> *changelog* files...
As the manual says,
If the expression contains no actions other than -prune, -print is per‐
formed on all files for which the expression is true.
In this example, -exec is an action, so the default -print does not occur.
James.