diff options
| author | Bernhard Voelker <mail@bernhard-voelker.de> | 2019-05-05 11:54:18 +0200 |
|---|---|---|
| committer | Bernhard Voelker <mail@bernhard-voelker.de> | 2019-05-10 08:05:08 +0200 |
| commit | 6743fefc3a1fc1386440b826b6d93500db7ca145 (patch) | |
| tree | ccee5334947ae79d033fa7d54572676877adff55 | |
| parent | cc130437f0c1e53de74b9ada9fde415c54a3080c (diff) | |
| download | findutils-6743fefc3a1f.tar.gz | |
find.1: correct description about -prune when -depth is in effect
The -prune action always returns true, also if -depth is in effect.
* find/find.1 (-prune): Remove the wrong statement that -prune would
return false when -depth is given. Furthermore, move the example down
from -path.
Reported by Cristian Zoicas in
https://lists.gnu.org/r/bug-findutils/2019-04/msg00024.html
| -rw-r--r-- | NEWS | 3 | ||||
| -rw-r--r-- | find/find.1 | 29 |
2 files changed, 19 insertions, 13 deletions
@@ -60,6 +60,9 @@ Both find.1 and the find texinfo manual now consistently document all of the 'N', 'L' and '?' possibilities in '-printf %Y' output when the determination of the type of a symlink target fails. +find.1 now correctly states the -prune has no effect when the -depth option is +given. Before, it wrongly stated that -prune would return false in that case. + Some minor documentation improvements are listed in "Bug Fixes" below. ** Bug Fixes diff --git a/find/find.1 b/find/find.1 index ca4b470..bcc1b32 100644 --- a/find/find.1 +++ b/find/find.1 @@ -777,10 +777,9 @@ The metacharacters (`*', `?', and `[]') match a `.\&' at the start of the base name (this is a change in findutils-4.2.2; see section STANDARDS CONFORMANCE below). To ignore a directory and the files under it, use -.BR \-prune ; -see an example in the -description of -.BR \-path . +.B \-prune +rather than checking every file in the tree; +see an example in the description of that action. Braces are not recognised as being special, despite the fact that some shells including Bash imbue braces with a special meaning in shell patterns. The filename matching is @@ -858,14 +857,7 @@ will print an entry for a directory called `./src/misc' (if one exists). To ignore a whole directory tree, use .B \-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: -.br -.in +1i -find . \-path ./src/emacs \-prune \-o \-print -.br -.in -1i +checking every file in the tree. Note that the pattern match test applies to the whole file name, starting from one of the start points named on the command line. It would only make sense to use an absolute path name here if the @@ -1609,7 +1601,9 @@ section for information about how unusual characters in filenames are handled. .IP \-prune True; if the file is a directory, do not descend into it. If .B \-depth -is given, false; no effect. Because +is given, then +.B \-prune +has no effect. Because .B \-delete implies .BR \-depth , @@ -1618,6 +1612,15 @@ you cannot usefully use and .B \-delete together. + 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: +.br +.in +1i +find . \-path ./src/emacs \-prune \-o \-print +.br +.in -1i + .IP "\-quit" Exit immediately. No child processes will be left running, but no more |
