bug-findutils
[Top][All Lists]
Advanced

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

Re: Finding shallowest instance of $foo in a given structure


From: RB
Subject: Re: Finding shallowest instance of $foo in a given structure
Date: Wed, 19 Mar 2008 08:30:16 -0600

>  Is that right?
That is correct, but having failed to apply basic shortcut logic with
parentheses and '-o', my search was painfully slow when testing due to
using only a single subtype (hint: follow your own requirements).
Hence, I presumed early on that -exec was the wrong way to go and
chased other rabbit trails.

> Using the above test case the following seems to work.
>
>   find srcdir \( -exec test -d {}/CVS \; -o -exec test -d {}/.svn \; -o -exec 
> test -d {}/.git \; \) -print -prune | sort

That works for me as well; I knew I had to be a few sandwiches short!
It also has the added benefit of being able to embed update statements
per VCS type, so I can cron this nicely and forget about it.  Thanks!


RB




reply via email to

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