Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!ucsd!pacbell.com!ames!sgi!vjs@rhyolite.wpd.sgi.com From: vjs@rhyolite.wpd.sgi.com (Vernon Schryver) Newsgroups: comp.sys.sgi Subject: Re: argument number limit Summary: see xargs(1) Message-ID: <78886@sgi.sgi.com> Date: 20 Dec 90 19:22:22 GMT References: <9012182223.AA05751@> Sender: guest@sgi.sgi.com Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 35 In article <9012182223.AA05751@>, brad@lsr-vax.UUCP (Brad Zoltick - LMO) writes: > We are running up against the number-of-arguments limit allowed on > the command line under the C shell. Is there a way to increase > this limit to a much larger value. Shell files that run properly under > SUNOS4 are failing under IRIX-3.31 with the error > > "argument number too large". No matter how large you make the shell and kernel arg limits, someone will hit them. For example, if you needed to fiddle with all of the files in a full netnews spool tree, no plausible limit would work. Xargs is of the few technical advantages SVR3 had compared to 4.3BSD. It solves most such problems. For example, the following command will grep all files in the current directory tree: find . -type f -print | xargs grep foobaz The -prune arg to find can also be used. Sed is also handy in such things: find . -type f -print | sed -e '/notthese/d' -e '/orthis/d' | xargs ... All of this is not to say whether the 3.3.1 csh has a small limit. We have radically increased the AT&T SVR3 kernel limit. I think csh is now pretty standard 4.3BSD, complete with command completion. Who knows what Sun has done? It should be noted that flat directories of hundreds of files are not efficient. Trees are much better for computers as well as people. Vernon Schryver, vjs@sgi.com