From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24177 invoked by alias); 16 Nov 2015 03:24:15 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 37125 Received: (qmail 13015 invoked from network); 16 Nov 2015 03:24:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern_com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version:content-type; bh=ewY7GuoPIK9BLJpFQ+5eChAUTPsUqFyfMhY7VXq1iAY=; b=nnyd+ynCkFrtJOcahJhIUTusuRi741e3WV5u6euvYzr5g4scyD5cjIL9ph+pOTFopR aPd8goo7JMJyWgBtryplpMnW9KdgejTEr1sa1JlN98BOOeTjdNQ9DMzElZNTq8uC617B G/c0pMAU3Oc7cgm0CUEWfMC+oClhFMdjPyIj26W9Sfodah970i4QcabMdmIzLO5i9g/0 HkrsPNFksVBojAwhrOrTFWLyToLE30rjDe5Hgvk6Tn5uZxGSrG1Pt1oi7X7ayyofpb1X RRDyRgZX1VqZaxdnqIuMnhPRj1TvClJqIsEepwGtUuYE1vHp7T9XCx5PDE1NE3IgUv0Q heDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version:content-type; bh=ewY7GuoPIK9BLJpFQ+5eChAUTPsUqFyfMhY7VXq1iAY=; b=RJ/2V76QOfY1rSVpMA3eBRiNmDQ67RbsT74RP8H/z0tMzGouS9xSCn5+ac5I9XpxUB 5KUqG1CG/l1wZbJmznjBINGWI9aAG+O2q059BxM5mid1w9KKIHawboO8U3OF7PA6InEH Tv9vtAxFj5DH9FUzxnUb+4DUxAniW25TJ5f6Er3kW18LRbTEnV0Bng2TbCgGS+ZQFGl6 h+ykcsUTfUOK4atoR6lY3DkIWINaGu6w3xj/7mGrZ3WVNeBG8l2ExNGad41Lggi2wut+ 8vfWjB1oRuf3JYqk/BuTIUCFpAX5HTNdNEPyrc3VjDZ3rXFJsd9gBiFG84EvBG2U7I3a vkzw== X-Gm-Message-State: ALoCoQlITFACGgJOJxkY4Blcj51x5nomwndTTLGrAe8tJzKj4He9jbB8o20VZK2i6+qZzOASt6+w X-Received: by 10.60.123.2 with SMTP id lw2mr11306071oeb.2.1447644250676; Sun, 15 Nov 2015 19:24:10 -0800 (PST) From: Bart Schaefer Message-Id: <151115192407.ZM20747@torch.brasslantern.com> Date: Sun, 15 Nov 2015 19:24:07 -0800 In-Reply-To: Comments: In reply to Mikael Magnusson "Re: Bug in alias expansion" (Nov 16, 1:50am) References: <20151115200356.0f3a80a2@ntlworld.com> <151115144805.ZM20614@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh workers Subject: Re: Bug in alias expansion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Nov 16, 1:50am, Mikael Magnusson wrote: } Subject: Re: Bug in alias expansion } } > In older versions of zsh it gagged in a different way: } > } > % alias -g foo='echo x)$(:' } > % print $(foo) } > zsh: parse error near `)' } > zsh: parse error in command substitution } } This error is definitely what I would expect from the above command. } It's expanded in the subshell If this were a normal command alias, I'd agree with you, but this is a global alias -- the parent shell should expand it wherever it is an unquoted shell word in the original command line, before the subshell is ever started. The "workaround" I posted in 37122 behaves the way you're thinking, but shouldn't be necessary. I suppose there's an argument to be made that a word inside $(...) is "quoted", but if so. the example I showed for "typeset frobozz[$(foo)]" (where xyz is expanded before parse_subscript() is called) must be wrong.