From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27602 invoked from network); 7 Jun 2001 07:29:47 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Jun 2001 07:29:47 -0000 Received: (qmail 10858 invoked by alias); 7 Jun 2001 07:29:28 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14782 Received: (qmail 10846 invoked from network); 7 Jun 2001 07:29:27 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer goliath.siemens.de) From: "Andrej Borsenkow" To: Subject: RE: ${...%%=*} problem Date: Thu, 7 Jun 2001 11:29:34 +0400 Message-ID: <000301c0ef23$99be1900$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 In-Reply-To: <200106070702.JAA24159@beta.informatik.hu-berlin.de> > > > bor@itsrm2% print ${foo%%=*} > > zsh: * not found > > > > Why? > > Because it does expansion, include the one after an equal sign: > This violates our own documentation: They are followed by _process substitution_, _parameter expansion_, _command substitution_, _arithmetic expansion_ and _brace expansion_ which are performed in one step in left-to-right fashion. After these expansions, all unquoted occurrences of the characters `\', `'' and `"' are removed, and the result is subjected to _filename expansion_ followed by _filename generation_. and later If a word begins with an unquoted `=' and the EQUALS option is set, the remainder of the word is taken as the name of a command or alias. If a command exists by that name, the word is replaced by the full pathname of the command. Granted, we do not have strict definition of ``word'' (as opposed to POSIX :-). In this context I suspect it more like POSIX ``field''. Still, = expansion happens after parameter substitution - not at the same time (and, actually, here it happens even before). -andrej