Bug 7920 - find . -name "$mask1" -or -name "$mask2" works incorrectly with -print, -printf and -print0
: find . -name "$mask1" -or -name "$mask2" works incorrectly with -print, -prin...
Status: CLOSED NOTABUG
: Sisyphus
(All bugs in Sisyphus/findutils)
: unstable
: all Linux
: P2 normal
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2005-09-11 02:18 by
Modified: 2007-04-21 16:30 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2005-09-11 02:18:48
find utility ignores complex search expressions when '-print*' is used.
Steps to Reproduce:
1. Lookup any source directory with many *.c and *.h files.
2. find /path/to/source -name "*.h" -or -name "*.c" | grep '\.c$'
3. find /path/to/source -name "*.h" -or -name "*.c" -print | grep '\.c$'
Actual Results:  
Files with second wildcard are ignored, only first wildcard is handled 
correctly.

Expected Results:  
All wildcards should be handled.
------- Comment #1 From 2005-09-11 21:58:36 -------
The 3rd case is equivalent of
find /path/to/source -name "*.h" -or "(" -name "*.c" -print ")"
you probably want to use
find /path/to/source "(" -name "*.h" -or -name "*.c" ")" -print