[comp.arch] Endian wars - really 386 questi

aglew@mcdurb.Urbana.Gould.COM (02/03/89)

>(Quick: who's run into Unix's 10K command-line limit?)

I `have` - ie. I have produced overlong commands using backquote
expansion. Although I seem to remember that the limit was considerably
smaller at the time (on a V7 hybrid running csh).
    I ran into so many of csh's built-in limits that I almost 
completely abandoned it for serious programming - although I still
used in interactively.

Limits make liars about the people who say that UNIX tools, pipes
and backquotes, provide composability of modules. Hurrah for 
Richard Stallman and his campaign to make it possible to let
the limit on filename size be infinite! Death to System V's
14 character filenames!


Andy "Krazy" Glew   aglew@urbana.mcd.mot.com   uunet!uiucdcs!mcdurb!aglew
   Motorola Microcomputer Division, Champaign-Urbana Design Center
	   1101 E. University, Urbana, Illinois 61801, USA.
   
My opinions are my own, and are not the opinions of my employer, or
any other organisation. I indicate my company only so that the reader
may account for any possible bias I may have towards our products.

rpw3@amdcad.AMD.COM (Rob Warnock) (02/03/89)

[(*Sigh*) I was replying to individuals directly when I saw lots of posted
replies, so I should probably say it here, even though its implication for
"architecture" is mainly the architecture of command line interfaces.]

+---------------
| (Quick: who's run into Unix's 10K command-line limit?)
+---------------

Yes, all of us, until we [most of us?] started using the standard utility
program "xargs" (used to be System-V only, until a p-d source for a useful
subset for 4.x BSD was posted several years ago). With "xargs", that 10k limit
becomes a non-issue. Instead of, for example:

	$ some_cmd -options `find <selection> -print`
try:
	$ find <selection> -print | xargs some_cmd -options

"Xargs" gathers lines from standard input until it gets "close" to the
system-established limits on command-line length, then runs "some_cmd"
with a "bunch" of args (repeating "-options" each time), then repeats
until EOF on input. It's also got options to limit the number of input
items gathered per bunch, so you can do things in pairs, triples, etc.

Simple idea. You could code one up quickly just given the idea. (But I
admit *I* never thought of it until the System-V "xargs" came out...)


Rob Warnock
Systems Architecture Consultant

UUCP:	  {amdcad,fortune,sun}!redwood!rpw3
ATTmail:  !rpw3
DDD:	  (415)572-2607
USPS:	  627 26th Ave, San Mateo, CA  94403

bader+@andrew.cmu.edu (Miles Bader) (02/03/89)

aglew@mcdurb.Urbana.Gould.COM writes:
> Limits make liars about the people who say that UNIX tools, pipes
> and backquotes, provide composability of modules. Hurrah for 
> Richard Stallman and his campaign to make it possible to let
> the limit on filename size be infinite! Death to System V's
> 14 character filenames!

Sigh...  We have thousands of source files that were created by people
using BSD.  Now it's been decided that they have to be compatible (to
facilitate future porting) with...  OS/2!  8+3 chars, no case
distinction, no leading periods.  Microsoft: just say Bleah.

-Miles

aglew@mcdurb.Urbana.Gould.COM (02/05/89)

..> Xargs

Close, although a pain to use. Makes me wish that xargs was a builtin,
and backquote substitution didn't exist.

[To give this a connection with architecture]: isn't this like the RISC
philosophy of providing only one, optimal, way to do things?

---

Soon I will be using news instead of @$%#@#@@! notes! Then I'll
be able to redirect and cross-post like the rest of you!

Let's get this out of comp.arch

dik@cwi.nl (Dik T. Winter) (02/05/89)

In article <24318@amdcad.AMD.COM> rpw3@amdcad.UUCP (Rob Warnock) writes:
 > +---------------
 > | (Quick: who's run into Unix's 10K command-line limit?)
 > +---------------
 > 
 > Yes, all of us, until we [most of us?] started using the standard utility
 > program "xargs" (used to be System-V only, until a p-d source for a useful
 > subset for 4.x BSD was posted several years ago). With "xargs", that 10k limit
 > becomes a non-issue. Instead of, for example:
 > 
 > 	$ some_cmd -options `find <selection> -print`
 > try:
 > 	$ find <selection> -print | xargs some_cmd -options
 > 
But of course the two are equivalent only if "some_cmd -options" uses only
one input file at a time.  Try:
	cc -o aap `find <selection> -print`
And if they are equivalent you could already do:
	find <selection> -exec some_cmd -options {} \;
(although you have a lot more processes).
-- 
dik t. winter, cwi, amsterdam, nederland
INTERNET   : dik@cwi.nl
BITNET/EARN: dik@mcvax