Bug 7920 - find . -name "$mask1" -or -name "$mask2" works incorrectly with -print, -printf and -print0
Summary: find . -name "$mask1" -or -name "$mask2" works incorrectly with -print, -prin...
Status: CLOSED NOTABUG
Alias: None
Product: Sisyphus
Classification: Development
Component: findutils (show other bugs)
Version: unstable
Hardware: all Linux
: P2 normal
Assignee: placeholder@altlinux.org
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-11 02:18 MSD by evseev
Modified: 2007-04-21 16:30 MSD (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description evseev 2005-09-11 02:18:48 MSD
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 Dmitry V. Levin 2005-09-11 21:58:36 MSD
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