Dave Brown wrote:
On Tue, Dec 29, 2009 at 12:24:52AM -0800, Michael G Schwern wrote:
 $ ls *
 -bash: /opt/local/bin/ls: Argument list too long

Really? Let me check... yes, the calendar says 2009. Fixed size argument lists, still? And just how large is this crushing wall of text? 368048 characters. 360k. My computer uses more memory to print the date than that!

Try "echo *" instead, and learn the exciting difference between your
kernel's maximum argv[] size and your shell's parameter buffer.

Oh, I'm all too painfully aware of the difference. Some shamefully small exec sizes I have known:

VMS: 256

POSIX minimum (used by old versions of IRIX):  4096

Microsoft nmake 1.5: 2048

A generated Makefile on a large project can easily blow over those paltry sizes.

OS X, fwiw, is 262144.


It's not that it's a buffer of 360 characters.  It's a buffer containing
thousands and thousands of things.

Not THOUSANDS!  Oh no!  I'll have to spin up another drum of memory! :P


And really.  Who in the hell types "ls *"?  I have an easier-to-type
alternative for you: "ls".  I bet you also type "cat onefile | filter".

I was doing something else in that directory originally and I forgot what it was. Probably feeding the list of files to Perl. There's any number of work arounds, but I hate work arounds and I hate hard wired limits.


--
<Schwern> What we learned was if you get confused, grab someone and swing
          them around a few times
        -- Life's lessons from square dancing

Reply via email to