bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #49453] find man page erroneous example


From: Andrey Hsiao
Subject: [bug #49453] find man page erroneous example
Date: Thu, 27 Oct 2016 04:00:30 +0000 (UTC)
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36

URL:
  <http://savannah.gnu.org/bugs/?49453>

                 Summary: find man page erroneous example
                 Project: findutils
            Submitted by: andreyhsiao
            Submitted on: Thu 27 Oct 2016 04:00:28 AM GMT
                Category: documentation
                Severity: 3 - Normal
              Item Group: Wrong result
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None
           Fixed Release: None

    _______________________________________________________

Details:

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







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49453>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]