From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5913 invoked from network); 25 Mar 2009 18:12:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) 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.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 25 Mar 2009 18:12:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 11600 invoked from network); 25 Mar 2009 18:11:55 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 25 Mar 2009 18:11:55 -0000 Received: (qmail 22829 invoked by alias); 25 Mar 2009 18:11:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 26791 Received: (qmail 22812 invoked from network); 25 Mar 2009 18:11:50 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 25 Mar 2009 18:11:50 -0000 Received: from vms173017pub.verizon.net (vms173017pub.verizon.net [206.46.173.17]) by bifrost.dotsrc.org (Postfix) with ESMTP id 2D56D80590EB for ; Wed, 25 Mar 2009 19:11:46 +0100 (CET) Received: from torch.brasslantern.com ([96.249.201.13]) by vms173017.mailsrvcs.net (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPA id <0KH200ECJQJ8E6RM@vms173017.mailsrvcs.net> for zsh-workers@sunsite.dk; Wed, 25 Mar 2009 13:11:37 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id n2PIBUMf007838; Wed, 25 Mar 2009 11:11:31 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id n2PIBUR4007837; Wed, 25 Mar 2009 11:11:30 -0700 From: Bart Schaefer Message-id: <090325111130.ZM7836@torch.brasslantern.com> Date: Wed, 25 Mar 2009 11:11:28 -0700 In-reply-to: <20090325172509.79c53d4d@news01> Comments: In reply to Peter Stephenson "Re: Bug#517008: alias not expanded with zsh -c" (Mar 25, 5:25pm) References: <20090225022850.GA4841@vin.lip.ens-lyon.fr> <20090325145418.GB9330@scru.org> <200903251630.n2PGU8sK013449@news01.csr.com> <20090325172509.79c53d4d@news01> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@sunsite.dk Subject: Re: Bug#517008: alias not expanded with zsh -c Cc: 517008@bugs.debian.org MIME-version: 1.0 Content-type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.92.1/9165/Wed Mar 25 16:08:41 2009 on bifrost X-Virus-Status: Clean On Mar 25, 5:25pm, Peter Stephenson wrote: } Subject: Re: Bug#517008: alias not expanded with zsh -c } } > Yes, at least as far as native zsh mode goes this isn't a bug. } } I should also have pointed out that the "emulate sh" doesn't make any } difference, it only takes effect after the string for -c has already been } parsed---it's basically the same issue as the alias expansion one itself. It's my recollection that the discussion of this on the austin-group list led to the conclusion that zsh's native behavior in this case is within the allowed variation in the POSIX spec. Vincent, if you're reading this, do you disagree, and can you point out why? My personal feeling is that aliases are an interactive convenience that should never be used in scripts (including "sh -c") in the first place. } You would need to start the shell in the appropriate mode. I don't think } that's an unreasonable requirement. Especially considering that now you can do emulate sh -c "..." which is admittedly a little clumsy to use as in zsh -c 'emulate sh -c "..."' but nevertheless is available to get the desired effect. } Is the fix as simple as the following? This is not a trick question, I } could very easily have missed something. Will this cover "emulate -c"? I'm a bit leery of even starting down this road, because it still fails to make any difference if the alias definition and use are on the same line (separated with ";" or "&&" etc.). --