[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:1.8.1.16) Gecko/20080702 Firefox/2.0.0.16 Mnenhy/0.7.5.666 |
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:
<http://savannah.gnu.org/bugs/?26883>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/