Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: 24948: max size of an array ?
- X-seq: zsh-users 10890
- From: Phil Pennock <phil.pennock@xxxxxxxxxxx>
- To: zsh-users <zsh-users@xxxxxxxxxx>
- Subject: Re: 24948: max size of an array ?
- Date: Thu, 19 Oct 2006 12:35:53 +0200
- In-reply-to: <453726F7.8030504@xxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <453726F7.8030504@xxxxxxxxxxxxxxxxxx>
- Sender: Phil Pennock <phil@xxxxxxxxxxxxx>
On 2006-10-19 at 09:19 +0200, Marc Chantreux wrote:
> I noticed that the max size of an array is 24948. Is it right ? Is there
> a way to work around ?
Are you sure that this is the limit of a zsh array and not the limit of
what can be passed in argv, given the size of your arguments, to a
command via the execve() system call on your OS?
% typeset -a mille; mille=()
% for ((i=0; i < 100; i+=1)) mille+=($i{0,1,2,3,4,5,6,7,8,9})
% print $#mille
1000
% typeset -a foo; foo=(); for ((i=0; i < 30; i+=1)) foo+=(${i}${mille})
% print $#foo
30000
On my OS, I can use print and /bin/echo just fine with that; if I repeat
the foo loop 100 times, so that $#foo is 100000, then I can use the zsh
print builtin but if I try to use /bin/echo I get:
zsh: argument list too long: /bin/echo
Is this the limit you're hitting?
Regards,
-Phil
Messages sorted by:
Reverse Date,
Date,
Thread,
Author