From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29709 invoked from network); 25 Jul 2005 17:47:09 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 25 Jul 2005 17:47:09 -0000 Received: (qmail 9467 invoked from network); 25 Jul 2005 17:47:04 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Jul 2005 17:47:04 -0000 Received: (qmail 17204 invoked by alias); 25 Jul 2005 17:46:58 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9166 Received: (qmail 17195 invoked from network); 25 Jul 2005 17:46:57 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 25 Jul 2005 17:46:57 -0000 Received: (qmail 8383 invoked from network); 25 Jul 2005 17:46:57 -0000 Received: from vms046pub.verizon.net (206.46.252.46) by a.mx.sunsite.dk with SMTP; 25 Jul 2005 17:46:53 -0000 Received: from candle.brasslantern.com ([71.116.88.149]) by vms046.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IK7008YG2Q1EGT0@vms046.mailsrvcs.net> for zsh-users@sunsite.dk; Mon, 25 Jul 2005 12:46:50 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j6PHkmqo028282 for ; Mon, 25 Jul 2005 10:46:48 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j6PHkmME028281 for zsh-users@sunsite.dk; Mon, 25 Jul 2005 10:46:48 -0700 Date: Mon, 25 Jul 2005 17:46:48 +0000 From: Bart Schaefer Subject: Re: Sorting file names randomly In-reply-to: <20050725131524.GC58@DervishD> In-reply-to: <20050725132754.GD58@DervishD> To: Zsh Users Message-id: <1050725174648.ZM28280@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050723194240.GA32416@DervishD> <20050723212657.GA744@DervishD> <1050724064415.ZM20425@candle.brasslantern.com> <20050724073914.GA2665@DervishD> <20050724083732.GA73@DervishD> <20050724084014.GA86@DervishD> <1050724103213.ZM20780@candle.brasslantern.com> <20050725131524.GC58@DervishD> <20050725132754.GD58@DervishD> Comments: In reply to DervishD "Re: Sorting file names randomly" (Jul 25, 3:15pm) Comments: In reply to DervishD "Re: Sorting file names randomly" (Jul 25, 3:27pm) X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Jul 25, 3:15pm, DervishD wrote: } } > it would be better to declare "local +h -Z 5 RANDOM" } > (Just remember to seed RANDOM when making it local.) } } Just to make sure: you can do whatever thing you want with } 'typeset' on a predefined shell parameter just like you would do with } your own parameters, right? Any important limitation? [From the follow-up message] } Anyway my question is still valid: can you do any valid } modification (not only -Z, but -L, -R, etc., -i, -E, -F...) to them } or every special parameter has its own constraints? There are no constraints if you use -h to hide the special meaning. When using +h, the constraints imposed by the predefined type of each parameter will apply. For example, you can't turn RANDOM into a float or an array, and specifying zero-padding for USERNAME will instead pad with spaces because you can't change the string to an integer. } > Fourth, you've eventually got to do this ... } > } reply=(${reply/#????? /}) } } Here I assumed that the array was processed one element at a time } so I didn't consider that the memory usage doubled. Cool :))) The ${reply/#????? /} part is processed one element at a time, but the entire right-side of the assignment expression has to be assembled from the results of the substitution before the actual assignment is done. } Bart, thanks a lot for your examples, but LOT'S of thanks for } your explanations. Por nada. Just keep asking interesting questions.