[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: |
Carles Pina i Estany |
Subject: |
Re: -iname a -or -iname b -exec: not on all files |
Date: |
Sun, 14 Sep 2008 17:31:48 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
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...
> ... since the (implicit) and operator has higher precedence than -or.
> See "OPERATORS" in the manual page - or if you are reading the
> Texinfo manual, "Combining Primaries With Operators".
Thank you very much. It was clearly my mistake.
--
Carles Pina i Estany GPG id: 0x17756391
http://pinux.info