From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15511 invoked from network); 12 May 2008 16:14:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 12 May 2008 16:14:48 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 31075 invoked from network); 12 May 2008 16:14:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 12 May 2008 16:14:43 -0000 Received: (qmail 15339 invoked by alias); 12 May 2008 16:14:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25007 Received: (qmail 15323 invoked from network); 12 May 2008 16:14:40 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 12 May 2008 16:14:40 -0000 Received: from cluster-d.mailcontrol.com (cluster-d.mailcontrol.com [217.69.20.190]) by bifrost.dotsrc.org (Postfix) with ESMTP id AE33E80ED172 for ; Mon, 12 May 2008 18:14:36 +0200 (CEST) Received: from rly07d.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly07d.srv.mailcontrol.com (MailControl) with ESMTP id m4CGEZsR008765 for ; Mon, 12 May 2008 17:14:35 +0100 Received: from submission.mailcontrol.com (submission.mailcontrol.com [86.111.216.190]) by rly07d.srv.mailcontrol.com (MailControl) id m4CGDowP005569 for zsh-workers@sunsite.dk; Mon, 12 May 2008 17:13:50 +0100 Received: from cameurexb01.EUROPE.ROOT.PRI ([62.189.241.200]) by rly07d-eth0.srv.mailcontrol.com (envelope-sender Peter.Stephenson@csr.com) (MIMEDefang) with ESMTP id m4CGDkgk004869; Mon, 12 May 2008 17:13:50 +0100 (BST) Received: from news01.csr.com ([10.103.143.38]) by cameurexb01.EUROPE.ROOT.PRI with Microsoft SMTPSVC(6.0.3790.3959); Mon, 12 May 2008 17:13:47 +0100 Received: from news01.csr.com (localhost.localdomain [127.0.0.1]) by news01.csr.com (8.14.2/8.13.4) with ESMTP id m4CGDl6u031986; Mon, 12 May 2008 17:13:47 +0100 Received: from csr.com (pws@localhost) by news01.csr.com (8.14.2/8.14.2/Submit) with ESMTP id m4CGDlhx031983; Mon, 12 May 2008 17:13:47 +0100 Message-Id: <200805121613.m4CGDlhx031983@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@sunsite.dk, 480889@bugs.debian.org Subject: Re: Bug#480889: zcompiling messes with alias-in-function expansion In-reply-to: <20080512160400.GA10140@scru.org> References: <20080512145509.GA15757@lapse.madduck.net> <20080512160400.GA10140@scru.org> Comments: In-reply-to Clint Adams message dated "Mon, 12 May 2008 17:04:00 +0100." Date: Mon, 12 May 2008 17:13:46 +0100 From: Peter Stephenson X-OriginalArrivalTime: 12 May 2008 16:13:47.0786 (UTC) FILETIME=[28AA5EA0:01C8B44B] X-Scanned-By: MailControl A-08-50-03 (www.mailcontrol.com) on 10.68.1.117 X-Virus-Scanned: ClamAV 0.91.2/7102/Mon May 12 15:06:15 2008 on bifrost X-Virus-Status: Clean Clint Adams wrote: > I imagine that this is somehow related to > > alias foo='echo bar'; foo Right, it's the same problem. Aliases are expanded early on, during input, and so you can't use an alias within the same chunk of shell code as where it's defined. This isn't going to change; you need to find a workaround. The standard approach is to use functions in such chunks of code. Aliases tend to be regarded as largely an interactive feature. This ought to be documented somewhere, if it isn't. -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070