bugfindutils - Bugs: bug #49453, find man page erroneous example

 
 

bug #49453: find man page erroneous example

Submitted by:  Andrey Hsiao <andreyhsiao>
Submitted on:  Thu 27 Oct 2016 04:00:28 AM UTC  
 
Category: documentationSeverity: 3 - Normal
Item Group: Wrong resultStatus: Duplicate
Privacy: PublicAssigned to: Bernhard Voelker <berny>
Originator Name: Open/Closed: Open
Release: NoneFixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 28 Oct 2016 02:41:19 PM UTC, comment #1:

Thanks for the report, however, this has already been reported in
http://savannah.gnu.org/bugs/?47482
and is already fixed in our Git repository:
http://git.sv.gnu.org/cgit/findutils.git/commit/?id=47d8fd38f7

Therefore, I'm marking this as 'Duplicate'.

Have a nice day,
Berny

Bernhard Voelker <berny>
Project MemberIn charge of this item.
Thu 27 Oct 2016 04:00:28 AM UTC, original submission:

Below example does not return expected results from the find man page EXAMPLES section.

"""
find repo/ -exec test -d {}/.svn \; -or \
-exec test -d {}/.git \; -or -exec test -d {}/CVS \; \
-print -prune

Given the following directory of projects and their associated SCM administrative directories, perform an efficient search for the projects' roots:

repo/project1/CVS
repo/gnu/project2/.svn
repo/gnu/project3/.svn
repo/gnu/project3/src/.svn
repo/project4/.git
"""

The command won't work as expected since 'and' has higher precedence than 'or'.

Adding the parentheses should fix the issue.

find repo/ \( -exec test -d {}/.svn \; -or \
-exec test -d {}/.git \; -or -exec test -d {}/CVS \; \) \
-print -prune

Andrey Hsiao <andreyhsiao>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by berny (Posted a comment)
  • -unavailable- added by andreyhsiao (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 28 Oct 2016 02:41:19 PM UTCbernyStatusNone=>Duplicate
      Assigned toNone=>berny

    Back to the top


    Powered by Savane 3.1-cleanup1