folding arguments

Larry McVoy lm at arizona.edu
Sat Feb 13 09:12:03 AEST 1988


In article <120 at gsg.UUCP> lew at gsg.UUCP (Paul Lew) writes:
>I used the following frequently:
>
>     $ find $DIR -print | awk '{print "command",$0}' | sh	(flexible)
>or:
>     $ find $DIR -print | sed 's/^/command /' | sh		(fast)
>
>Both are shorter than the 2nd command and it does not need program 'fa'.

But I think this has the following problem: "command" gets exec-ed
once per argument.   That's exactly what I want to avoid.  I really
want infinite space for args to exec but failing that I want something
that bunchs up args into suitable form for an exec.  So fa will fit as
many as it can in, say 5000 bytes (configurable at runtime), so I don't
have to run the same command so many times.
-- 
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