From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72 invoked from network); 6 Sep 2005 14:58:59 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 Sep 2005 14:58:59 -0000 Received: (qmail 55773 invoked from network); 6 Sep 2005 14:58:52 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 Sep 2005 14:58:52 -0000 Received: (qmail 4896 invoked by alias); 6 Sep 2005 14:58:42 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9394 Received: (qmail 4885 invoked from network); 6 Sep 2005 14:58:41 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 6 Sep 2005 14:58:41 -0000 Received: (qmail 54662 invoked from network); 6 Sep 2005 14:58:41 -0000 Received: from vms040pub.verizon.net (206.46.252.40) by a.mx.sunsite.dk with SMTP; 6 Sep 2005 14:58:36 -0000 Received: from candle.brasslantern.com ([71.116.79.190]) by vms040.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IME00CX8HLMEJ4A@vms040.mailsrvcs.net> for zsh-users@sunsite.dk; Tue, 06 Sep 2005 09:58:35 -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 j86EwYKn009940 for ; Tue, 06 Sep 2005 07:58:34 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j86EwXfK009939 for zsh-users@sunsite.dk; Tue, 06 Sep 2005 07:58:33 -0700 Date: Tue, 06 Sep 2005 14:58:33 +0000 From: Bart Schaefer Subject: Re: Factoring out code In-reply-to: <20050906103718.GB63@DervishD> To: Zsh Users Message-id: <1050906145833.ZM9938@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <20050905114253.GA7132@DervishD> <1050905200819.ZM8987@candle.brasslantern.com> <20050906103718.GB63@DervishD> Comments: In reply to DervishD "Re: Factoring out code" (Sep 6, 12:37pm) 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.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.4 On Sep 6, 12:37pm, DervishD wrote: } } So, how can I make a function to use the *global* argv and not } the local one? Can a function modify the global argv? You can't, and no. The only thing you could do would be to establish a convention, such as the one with reply/REPLY, and always remember to "set -- $reply" after calling one of those functions. If you don't like using eval on a variable that contains a code fragment, how about using a set of aliases? Each alias would "run like [it] was cut ... and pasted into the file, just like a macro." Your scripts would still end up looking more like the example with multiple dot-commands, but you can put all the alias definitions in one file.