Looking for a "sophisticated" find script
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Looking for a "sophisticated" find script




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Looking for a "sophisticated" find script  
Generic Usenet Account


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-25-05 11:07 PM

I want to launch a "find" query, and I want to exclude some directories
from the search.  I am looking for something like this:

find . -type f & excludes specified directories -exec do-something {}
\;

or

find . -type f -exec excluding specified directories do-something {} \;


Thanks,
Gus






[ Post a follow-up to this message ]



    Re: Looking for a "sophisticated" find script  
rolandberry@hotmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-25-05 11:07 PM



Generic Usenet Account wrote:
> I want to launch a "find" query, and I want to exclude some directories
> from the search.  I am looking for something like this:
>
> find . -type f & excludes specified directories -exec do-something {}
> \;
>
>            or
>
> find . -type f -exec excluding specified directories do-something {} 
\;
>
>
> Thanks,
> Gus

pipe the output through grep -v to get rid of the stuff you don't want






[ Post a follow-up to this message ]



    Re: Looking for a "sophisticated" find script  
Rakesh Sharma


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-25-05 11:07 PM



Generic Usenet Account wrote:
> I want to launch a "find" query, and I want to exclude some directories
> from the search.  I am looking for something like this:
>
> find . -type f & excludes specified directories -exec do-something {}
> \;
>
>            or
>
> find . -type f -exec excluding specified directories do-something {} 
\;
>


/bin/find . \
\( -type d \( -name xcludir1 -o -name xcludir2 \) -prune \) \
-o \
-exec Do_Something {} \;






[ Post a follow-up to this message ]



    Re: Looking for a "sophisticated" find script  
Bill Marcum


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-25-05 11:07 PM

["Followup-To:" header set to comp.unix.shell.]
On 25 Jul 2005 08:39:15 -0700, Generic Usenet Account
<usenet@sta.samsung.com> wrote:
> I want to launch a "find" query, and I want to exclude some directories
> from the search.  I am looking for something like this:
>
> find . -type f & excludes specified directories -exec do-something {}
> \;
>
Look at the "-prune" option.

find . -name excluded_dir -prune -o -type f -exec do_something {} \;


-- Tonight you will pay the wages of sin; Don't forget to leave a tip.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:55 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register