folding arguments

John Young jgy at hropus.UUCP
Sat Feb 13 01:23:21 AEST 1988


> I frequently do stuff like
> 
> $ command `find $DIR -print`
> 
> which bombs out when I find too many files.  I've written a little program
> that lets me do
> 
> $ find $DIR -print | fa | while read x; do command $x; done
> 
> Im willing to post it since it might be useful to others but first I'd like
> to know if you've got a better solution.  
> 

Yes, on System V you can say:

$ find $DIR -print | xargs command

xargs will read it's standard input and by default execute 'command'
with as many arguments as can fit.  As usual there are an array of
other options.



More information about the Comp.unix.wizards mailing list