example in man page doesn't work (due to user making assumption...)

Bug #6087 reported by Zooko Wilcox-O'Hearn
2
Affects Status Importance Assigned to Milestone
findutils
Unknown
Unknown
findutils (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The find(1) man page says:

 - wholename pattern
    File name matches shell pattern pattern. The metacharacters do not treat `/' or `.' specially;
    so, for example, find . -wholename './sr*sc' will print an entry for a directory called './src/misc'
    (if one exists). To ignore a whole directory tree, use -prune rather than checking every file
    in the tree. For example, to skip the directory `src/emacs' and all files and directories under
    it, and print the names of the other files found, do something like this:
              find . -wholename './src/emacs' -prune -o -print

Okay, so let's try it:

zooko@yumyum:~/foo$ mkdir splat
zooko@yumyum:~/foo$ mkdir gronk
zooko@yumyum:~/foo$ mkdir gronk/fluff
zooko@yumyum:~/foo$ find . -wholename './gronk/' -prune -o -print
./gronk
./gronk/fluff
./splat

Directory gronk and its subtree is not skipped, while I was expecting that to happen.

The problem is the trailing "/" in my pattern. I'm used to writing a trailing "/" whenever I write a directory name. I wonder if it is possible for the man page to disabuse the casual reader of this assumption.

description: updated
description: updated
Revision history for this message
nine (niin-deactivatedaccount-deactivatedaccount) wrote :

Added bugwatch.

Changed in findutils:
status: New → Unknown
Revision history for this message
IKT (ikt) wrote :

I'm not sure why this hasn't had its status changed to fix released?

From the project bug tracker:

Tue 14 Jul 2009 10:37:31 PM UTC, comment #9:

Fixed in the 4.5.x tree.

---------

If anyone feels the need to re-open, please do so.

Changed in findutils (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.