folding arguments

Larry McVoy lm at arizona.edu
Fri Feb 12 07:16:23 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

I'm 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.  

The problem is splitting a find stream into lines that will fit into
argv.  Fa will take options as to what is reasonable; defaults are 5000
chars and 1000 args max.) I'd rather not have to drag this around but I
don't want some gross shell script solution either (i.e. I want to be
able to get it all in on one command line == ~80 chars).  I'd use xargs
but that's a s5-ism.  Is there a BSD equiv?

Comments?
-- 
Larry McVoy	lm at arizona.edu or ...!{uwvax,sun}!arizona.edu!lm
		Use the force - read the source.



More information about the Comp.unix.wizards mailing list