From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19474 invoked by alias); 8 Nov 2012 08:50:33 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17384 Received: (qmail 14286 invoked from network); 8 Nov 2012 08:50:31 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at linux.vnet.ibm.com does not designate permitted sender hosts) Date: Thu, 8 Nov 2012 16:40:01 +0800 From: Han Pingtian To: zsh-user Subject: argv subscript range uses too many memory Message-ID: <20121108084001.GA7594@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12110808-8974-0000-0000-000010D3CB24 X-IBM-ISS-SpamDetectors: X-IBM-ISS-DetailInfo: BY=3.00000295; HX=3.00000198; KW=3.00000007; PH=3.00000001; SC=3.00000008; SDB=6.00189470; UDB=6.00042903; UTC=2012-11-08 08:40:08 Hi, This script on my laptop uses so much memory so that being killed by oom-killer: arr=(~/**/*) set -- "${(@)arr}" while ((ARGC)) do print -- "${argv[1,3]}" shift 3 done But if change the subscript range to single array elements, it works just fine. So I suspect there is something wrong with the subscript range. Any thoughts? Thanks in advance.