On Sun, Sep 14, 2008 at 4:31 PM, Carles Pina i Estany <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> On Sep/14/2008, James Youngman wrote:
>> On Sun, Sep 14, 2008 at 3:45 PM, Carles Pina i Estany <[EMAIL PROTECTED]> 
>> 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.


Reply via email to