[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #26883] "or" condition and -exec directive

From: Eric Blake
Subject: [bug #26883] "or" condition and -exec directive
Date: Thu, 25 Jun 2009 11:58:30 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20080702 Firefox/ Mnenhy/

Update of bug #26883 (project findutils):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 


Follow-up Comment #1:

Not a bug.

find -name '*.txt' -o -name '*.dat'

is equivalent to:

find ( -name '*.txt' -o -name '*.dat' ) -print

Your second example:

find -name '*.txt' -o -name '*.dat' -exec echo {} ;

is equivalent to:

find -name '*.txt' -o ( -name '*.dat' -a -exec echo {} ; )

In short, -a binds tighter than -o, and putting two operators side-by-side is
equivalent to using -a between them.  You meant to type:

find ( -name '*.txt' -o -name '*.dat' -) -exec echo {} ;


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]