[lfs-support] Using 'find' to Help Make Package Users Simpler

Dan McGhee beesnees at grm.net
Wed Oct 16 13:59:41 PDT 2013


On 10/16/2013 03:15 PM, Pierre Labastie wrote:
> I've never tried two -exec directives in find, sorry. What I know is that xargs is more flexible,
> and I recommand that you insist on having it work.
> It could be something similar to:
> find... -print| xargs -I xxx sh -c 'chmod xxx; chown xxx; echo xxx >> installdirs.lst'
> more robust:
> find... -print0 | xargs -0 -I xxx sh -c 'chmod xxx; chown xxx; echo xxx >> installdirs.lst'
>
> Good luck
> Pierre
Thank you, Pierre!  I now know why I was not successful with xargs. I 
didn't know about "sh -c".  I never really jumped into the examples at 
the end of the man page. And know I need to really get a firm handle on 
all the options for xargs so I can use it.

I don't understand, though, "-I xxx".  First, I don't know what the xxx 
would mean, and secondly, the way I see it in my limited knowlege, the 
file name would be the standard input, but what "string" would it be 
replacing.  My understanding of -I is that standard input would replace 
some string.  Would you please tell me if my understanding of -I is 
right, and then indicate what I might put in place of "xxx".

Thanks,
Dan




More information about the lfs-support mailing list