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

Re: Length of argument list



On Wed, Jun 10, 2015 at 8:48 PM, Manfred Lotz <manfred.lotz@xxxxxxxx> wrote:
> Hi all,
> I created 1 million files in a directory callend manyfiles/.
>
> Now
> ls manyfiles/* |wc -l
>
> gives
> zsh: argument list too long: ls
>
>
> Question: Is there a way to change the maximum size of the argument
> list?

That depends on your operating system, on linux it is guided by ulimit
-s (in particular, the argument list is a quarter of the stack size).
On other operating systems, the limit is traditionally quite small.
I'm assuming the above is just an example, but that particular thing
would be better handled by () { echo $# } manyfiles/*, or some
xargs/zargs contraption if you want to be more general.

-- 
Mikael Magnusson



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