Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!uakari.primate.wisc.edu!aplcen!ginosko!uunet!crdgw1!crdgw1.ge.com!barnett From: barnett@crdgw1.crd.ge.com (Bruce Barnett) Newsgroups: comp.unix.wizards Subject: Re: Look! An xargs!! (Re: recursive grep) Message-ID: <2237@crdgw1.crd.ge.com> Date: 11 Sep 89 17:45:00 GMT References: <666@lakart.UUCP> <1641@cbnewsl.ATT.COM> <7774@cbmvax.UUCP> <16816@pasteur.Berkeley.EDU> <1126@virtech.UUCP> <2404@wyse.wyse.com> <10967@smoke.BRL.MIL> <2415@wyse.wyse.com> <10978@smoke.BRL.MIL> <2205@crdgw1.crd.ge.com> <1086@philmds.UUCP> Sender: news@crdgw1.crd.ge.com Reply-To: barnett@crdgw1.crd.ge.com (Bruce Barnett) Organization: GE Corp. R & D, Schenectady, NY Lines: 33 In-reply-to: leo@philmds.UUCP (Leo de Wit) In article <2205@crdgw1.crd.ge.com> I posted the sources to xargs.c In article <1086@philmds.UUCP>, leo@philmds (Leo de Wit) writes: >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. I forgot to include the source of the xargs I posted. It was mod.sources, V3, n106. Written by Gordon A. Moffett. Posted Feb, 1986. I might as well include Gordon's disclaimer: "Here is a reimplementation of the System V utility xargs. I haven't heard any complaints about it, though [1] There is room for improvement regarding the command buffer size (tho' it is better than the System V area in that particular regard) [2] It does not have all the features of the System V version (as the man page points out)." I suggest if someone finds this program offensive, they should fix it up and send a new version to comp.sources.unix. I can assure you I will not be offended. -- Bruce G. Barnett uunet!crdgw1!barnett