[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: "-contains" option
From: |
James Youngman |
Subject: |
Re: RFC: "-contains" option |
Date: |
Sat, 21 Feb 2009 22:38:04 +0000 |
On Sat, Feb 21, 2009 at 10:23 PM, Eddie Kohler <address@hidden> wrote:
> exclude=$(find . -name .find-ignore -printf '%h\n' | sort -u); find . \! \(
> -false $(for e in $exclude ; do printf ' -o -name "%s" ' $e; done) \) ,
> -true > /dev/null
> => 3.06s
There is a -prune missing from both find expressions there I think.
The first can be pruned because once we find a .find-ignore file we
don't need to search for more .find-ignore files in subdirectories.
The second needs a -prune because that's the point of putting the
.find-ignore file there.
> 3.06s is much much much better than -execdir; but -contains is still
> easier to type :)
It's fair to say I think that my concern around -contains has to do
with the fact that it seems to be an extra feature designed for only
one use case. I avoid adding new features which only have limited or
special-case uses.
Can you think of a more generally useful (i.e. more generic) feature
which might also lend itself to your problem?
James.