Look! An xargs!! (Re: recursive grep)

Leo de Wit leo at philmds.UUCP
Mon Sep 11 20:53:52 AEST 1989


In article <2205 at crdgw1.crd.ge.com> barnett at crdgw1.crd.ge.com (Bruce Barnett) writes:
|In article <10978 at smoke.BRL.MIL>, gwyn at smoke (Doug Gywn) writes:
|
|>Why not simply write a genuine xargs implementation, say in C where you
|>can do it right without a lot of hassle.
|
|Hear! hear!
|
|Who really cares if you can *ALMOST* do it in 35 lines when you can do
|it *RIGHT* in 70?
|
|Forgive this posting of the sources in this newsgroup, but maybe it will
|reduce the noise level. Here is the version of xargs.c from comp.sources.whatever

    [next wrong xargs implementation deleted]

This program doesn't handle spaces in arguments correctly. Moreover,
since the system() function is used to fire up the command, an
(incorrect) re-interpretation of the arguments is done (think of
metacharacters like ',\,",$,` etc). This can be dealt with much better
by using argv[] directly (and execve(), left as an exercise for the
reader).  Another bad feature is the use of gets(); I'd like to feed a
> BUFSIZ line to your xarrrrrgs. Lastly, your xargs does a poor
performance job:  the system imposed limit on argument lists is
typically much higher than BUFSIZ.

   Leo.



More information about the Comp.unix.wizards mailing list