[Top][All Lists]

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

Why is -mindepth a option and not a test as on *BSD?

From: Andreas Metzler
Subject: Why is -mindepth a option and not a test as on *BSD?
Date: Thu, 13 May 2004 16:44:21 +0200
User-agent: Mutt/1.5.6i

Mark Sheppard has pointed my attention on this:

$ mkdir -p ./a/aa/aaa ./b/bb c
$ find \( -path ./a -prune \) -o \( -type d -empty -mindepth 2 -print \)

The prune action should have matched the "a" directory and prevented
./a/aa/aaa from even being looked at, but that didn't happen.  It
looks like the -mindepth option is incorrectly applied to the first
expression (before the -o) too, like it's an option that's processed
globally rather than properly nested according to the given

I have checked the documtation and actually this is no bug in find,
because it is documented. -mindepth is no test, but an option in GNU
find.  I assume it is impossible to change GNU find in this respect,
as it will break backwards compatibility.

FWIW in (Net|Free|Opeb)BSD -mindepth is a test.
                 cu andreas
"See, I told you they'd listen to Reason," [SPOILER] Svfurlr fnlf,
fuhggvat qbja gur juveyvat tha.
Neal Stephenson in "Snow Crash"

reply via email to

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