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

 
 

bug #49453: find man page erroneous example

Submitter:  Andrey Hsiao <andreyhsiao>
Submitted:  Thu 27 Oct 2016 04:00:28 AM UTC
   
 
Category:  documentation Severity:  3 - Normal
Item Group:  Wrong result Status:  Duplicate
Privacy:  Public Assigned to:  berny
Originator Name:  Open/Closed:  Closed
Release:  None Fixed Release:  4.6.0
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group administrator
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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-09 berny Open/ClosedOpen Closed
        Fixed ReleaseNone 4.6.0
    2016-10-28 berny StatusNone Duplicate
        Assigned toNone berny

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code