[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: "-contains" option
From: |
Eddie Kohler |
Subject: |
Re: RFC: "-contains" option |
Date: |
Sat, 21 Feb 2009 14:23:48 -0800 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20090105) |
James Youngman wrote:
exclude=$(find . -name .find-ignore -printf '%h\n' | sort -u)
find . \! \( -false $( for e in $exclude ; do printf ' -o -name "%s" '
$e; done) \)
It's about twice as slow as -contains -- as you might expect, since it
traverses the directory structure twice.
find . -type d , -true > /dev/null
=> 1.41s
find . -contains .find-ignore , -true > /dev/null
=> 1.53s
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
3.06s is much much much better than -execdir; but -contains is still
easier to type :)
E