bin/66613: find(1): -mindepth and -maxdepth doesn't work as
expected
Oliver Eikemeier
eikemeier at fillmore-labs.com
Thu May 13 15:40:34 PDT 2004
The following reply was made to PR bin/66613; it has been noted by GNATS.
From: Oliver Eikemeier <eikemeier at fillmore-labs.com>
To: FreeBSD-gnats-submit at FreeBSD.org
Cc:
Subject: Re: bin/66613: find(1): -mindepth and -maxdepth doesn't work as expected
Date: Fri, 14 May 2004 00:34:52 +0200
Ok, here is the patch, applies to -CURRENT and -STABLE:
Index: find.1
===================================================================
RCS file: /home/ncvs/src/usr.bin/find/find.1,v
retrieving revision 1.59
diff -u -r1.59 find.1
--- find.1 21 Apr 2004 00:42:55 -0000 1.59
+++ find.1 13 May 2004 22:22:29 -0000
@@ -427,11 +427,23 @@
.Nm ls Fl dgils .
.Ek
.It Ic -maxdepth Ar n
-True if the depth of the current file into the tree is less than or equal to
+Always true; do not apply any tests or actions at levels less than
.Ar n .
+If any
+.Ic -maxdepth
+primary is specified, it applies to the entire expression even if it would
+not normally be evaluated.
+.Ic -maxdepth Ar 0
+limits the whole search to the command line arguments.
.It Ic -mindepth Ar n
-True if the depth of the current file into the tree is greater than or equal to
-.Ar n .
+Always true; descend at most
+.Ar n
+directory levels below the command line arguments. If any
+.Ic -mindepth
+primary is specified, it applies to the entire expression even if it would
+not normally be evaluated.
+.Ic -mindepth Ar 1
+processes all but the command line arguments.
.It Ic -mmin Ar n
True if the difference between the file last modification time and the time
.Nm
I'm not sure if `Ic' is the right tag, it is in line with the rest of the man
page. Be aware that -mindepth and -maxdepth are not included in the posix
standard, they are GNU extensions to find(1). The semantics are compatible with
GNU find, though.
-Oliver
More information about the freebsd-bugs
mailing list