Bug 121055

Summary: find can't "-exec grep" with strings protected via braces
Product: [Fedora] Fedora Reporter: Tom Wood <woodt>
Component: findutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-04-16 15:10:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Wood 2004-04-16 14:48:11 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031202

Description of problem:
While trying to figure out how FC handles zeroconf networking, I
stumbled on a bug whereby a combination of "find" and "-exec grep"
don't work well together.

Version-Release number of selected component (if applicable):
findutils-4.1.7-17

How reproducible:
Always

Steps to Reproduce:
1. cd /etc/sysconfig
2. find . -type f -exec egrep -i zeroconf {} \; -print
3. Watch as nothing is returned.
4. cd /etc/sysconfig/network-scripts
5. egrep -i zeroconf *
6. Watch as several hits are displayed.
    

Actual Results:  find with -exec egrep didn't return any hits.

Expected Results:  find with -exec egrep should have returned hits.

Additional info:  This seems to happen with text that's somehow
escaped.  The above example should have returned a line with
"{ZEROCONF}" in it.  The curly braces may be interfering somehow.

Comment 1 Tim Waugh 2004-04-16 15:10:10 UTC
None of the *files* in /etc/sysconfig contain that string.  There is a
*symlink* to a file (outside that directory) that does..

So perhaps you meant:

find /etc/sysconfig -type f -o -type l -exec egrep -qi zeroconf \{} \;
-print

Comment 2 Tom Wood 2004-04-16 16:31:53 UTC
Thank you.  I thought -f would follow symlinks.  Sorry for the stupidity.