From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4591 invoked by alias); 16 Nov 2015 05:42:58 -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: 37126 Received: (qmail 15789 invoked from network); 16 Nov 2015 05:42:57 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=UVQT0FIihBXy3syyvG09ESEbqG6G55hheuucBYnUDPY=; b=F7DGwwZfHbDMhoFDZfn7KqzJRQorNhDtFZQ2KefjsPWcwQz1mH62pmoRImIG+4ev2J BVN69evy8ohdlslwwOtLrQyj7KlyY5BRVklORlPPpGRPqkYc7aAeTh1Sfqss5TdDCD4I 7zNH8bkL5Udznh9ekW7+eVF1nSh2Pp5/JmwBSevgDcVZUAJVmd+y4t8egDqLRKvofNIo tu1fhCsa0sufExZ5zduz9jP7I9AaP3c19TS3OyZTnMw8fNNX+a5xfVBcRsStkXs6oq6i 3iRe5rYr3Q0iP3K/jpOkC32j7fAtkpPZ2IWn0cvAVRCNMlrfuhhTnGBs8s4NguBZZ3PW w9SQ== MIME-Version: 1.0 X-Received: by 10.140.134.135 with SMTP id 129mr18838364qhg.58.1447652574942; Sun, 15 Nov 2015 21:42:54 -0800 (PST) In-Reply-To: <151115192407.ZM20747@torch.brasslantern.com> References: <20151115200356.0f3a80a2@ntlworld.com> <151115144805.ZM20614@torch.brasslantern.com> <151115192407.ZM20747@torch.brasslantern.com> Date: Mon, 16 Nov 2015 06:42:54 +0100 Message-ID: Subject: Re: Bug in alias expansion From: Mikael Magnusson To: Bart Schaefer Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On Mon, Nov 16, 2015 at 4:24 AM, Bart Schaefer wrote: > 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. As the commands you didn't quote show, this doesn't seem to be the case, and I don't think it should either. > 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. -- Mikael Magnusson