Re: find/grep file extensions

From: Stephane CHAZELAS (this.address_at_is.invalid)
Date: 11/30/04


Date: Tue, 30 Nov 2004 09:14:31 +0000

2004-11-29, 18:53(-05), Bill Marcum:
[...]
>> find . -name "*.[fcChb] *.[cC][cC]" -exec grep \!* /dev/null \{\} \;
>> find . -name "{*.[fcChb]}{[cC]}" -exec grep \!* /dev/null \{\} \;
>>
> find . -name "*.[fcChb]" -o -name "*.[cC][cC]"
>
> If you have GNU find, -iname is case insensitive.
[...]

You need parenthesis as -a (implied when missing) has higher
precedence than -o

find . -name ... -o -name ... -exec ...

is

find . \( -name ... \) -o \( -name ... -exec ... \)

You need

find . \( -name ... -o -name ... \) -exec ...

-- 
Stephane


Relevant Pages

  • Re: gtk20 brokenness
    ... >>apparently the gtk20 port is broken. ... chances are you're missing another ... generated by GNU Autoconf 2.57. ... gcc version 2.95.4 20020320 [FreeBSD] ...
    (freebsd-questions)
  • Re: print(true and true) #=> the parenthesis issue
    ... :14: syntax error, unexpected kAND, expecting ')' ... whereas in print parenthesis are affecting ... precedence of passed-in expression. ... enclosing parenthesis to behave like precedence modifiers as well, ...
    (comp.lang.ruby)
  • Re: Ordered subquery
    ... from tmpINTERVALS as t2 ... The error is "missing right parenthesis". ... SQL command not properly ended ...
    (comp.databases.oracle.server)
  • Re: find files / folders n levels deep
    ... files/folders that are 'n' levels deep. ... Am I missing something obivous? ... you'd better install the GNU find because there are ...
    (comp.unix.shell)
  • Re: Syntax appears inconsistent - why is this?
    ... Whenever I find myself about to say that to Abigail, ... (and enclosing the list in parentheses where precedence requires it): ... The "fat comma" is indeed sugar, but I don't think anyone was confused ... We have been discussing the role of the parenthesis ...
    (comp.lang.perl.misc)