[mdlug] Finding something for a cat

John Wiersba jrw32982 at yahoo.com
Tue Aug 17 09:06:10 EDT 2010


Why not just simplify things by avoiding -exec in find?  I almost always find 
that I can do what I want with a simple shell loop like the following.  It's so 
much easier to read than all the escaping and quoting you need in order to embed 
the command you need as an argument to find.

find . -type d |
while read dir ;do
   # Do whatever you want with each $dir
done


      



More information about the mdlug mailing list