example in man page doesn't work (due to user making assumption...)
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 |
Added bugwatch.