LWN.net Logo

Advertisement

E-Commerce & credit card processing - the Open Source way!

Advertise here

Useless use of find -exec...

Useless use of find -exec...

Posted Jul 22, 2003 11:38 UTC (Tue) by Dom2 (guest, #458)
In reply to: Useless use of ... by mikal
Parent article: Graphics tricks from the Linux command line (IBM developerWorks)

find . -type f -name "*.jpg" -exec blah {} \;

That's not more correct; you should be using xargs(1). :-)

find . -name '*.jpg' | xargs blah

The usual caveat about filenames with spaces in them requiring this instead:

find . -name '*.jpg' -print0 | xargs -0 blah

-Dom


(Log in to post comments)

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds