On 09/13/14 11:51, Doug Hughes wrote:
> FWIW: this is a perfect use case for xargs instead of exec. You'll save 
> a lot of fork/clone system calls and simplify your find. Brandon pointed 
> out the main problem, but consider this alternative:
> 
> find . -name '*.cs' -print -o -name '*.c' -print -o -name '*.h' -print | 
> xargs grep file-io.c
> 

I have run into issues with "-print" and "xargs"... spaces in filenames...
Doesn't happen much when dealing with source code (.c .cs .h), but it happens
a lot when dealing with music and documents from Windows/Mac users.

find . \( -name '*.cs' -o -name '*.c' -o -name '*.h' \) -print0 | xargs -0 grep 
blah

:)

-- 
Mr. Flibble
King of the Potato People
http://www.linkedin.com/in/RobertLanning
_______________________________________________
Tech mailing list
Tech@lists.lopsa.org
https://lists.lopsa.org/cgi-bin/mailman/listinfo/tech
This list provided by the League of Professional System Administrators
 http://lopsa.org/

Reply via email to