Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh arg list too long



Hrvoje Niksic <hniksic@xxxxxxx> wrote:
> In your mail, you said:
> > Last time I only tried   rm  ~/.netscape-cache/*
> > and it failed because there were (only) 576 files (filename length 24)
> 
> I noticed it too. It should not be OS restriction, since it works in other
> shells. I am afraid it is a zsh bug.

What other shells does it work?  The `arg list too long' message comes from
the OS.  If the arg list is long execve fails and sets errno to E2BIG.
Builtin zsh commands can have arbitrary long argument lists.  If you do not
believe me, grep the zsh source for the arg list too long message.  You won't
find it.  The maximum allowed length of the argument list is very OS
dependent.  E.g. on Linux I can do:

bolyai /l/src % /bin/echo ([nzk]|t[^au])*/**/*|wc
      1    4346  127155

But here 128k is the maximum.  On Ultrix and probably on other OS'es as well
the limit is much lower.

Note that you must use /bin/echo above since the echo builtin can have any
number of arguments.

Cheers,

Zoltan



Messages sorted by: Reverse Date, Date, Thread, Author