From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26246 invoked by alias); 23 Sep 2011 10:51:27 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 16407 Received: (qmail 23998 invoked from network); 23 Sep 2011 10:51:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.214.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=QSgT+k1uw2LiLrolQUWMkTlOwQZeS596C7gImtiXLqM=; b=nL5cCxyudBQgnfwNx+SaQTdKQ8PGun5Uyv66GWNL2E7hDixP0uqG9n/gFr3Vrp3aBS nBSUk9av/gU8tbbeCGsqMmZZR4Nviv8HQAFaAnPqSdRuAbARjJOchVucdQoOGYRB9xrI ZRVy6lNVXTIyqVT9lVZ0jXNDbrt60nFtRXxSE= Message-ID: <4E7C64A5.805@gmail.com> Date: Fri, 23 Sep 2011 13:51:17 +0300 From: Volodya Khomchak User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: Mikael Magnusson CC: zsh-users@zsh.org Subject: Re: Strange behavior with "for i in .." References: <4E7C5F9D.2070308@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Yes, you are right :) Thanks. On 09/23/2011 01:41 PM, Mikael Magnusson wrote: > On 23 September 2011 12:29, Volodya Khomchak wrote: >> Hi, >> >> I faced with strange behavior with "for i in ..". >> So the problem is next: >> # for i in /etc/profile.d/*.sh;do echo $i;done >> # zsh: bad math expression: operand expected at `/etc/profi...' >> But if I change "i" to "file" it would work: >> # for file in /etc/profile.d/*.sh;do echo $file;done >> # /etc/profile.d/1.sh >> # /etc/profile.d/2.sh >> >> zsh --version >> zsh 4.3.10 (x86_64) >> >> So what is going on here ? > > At some point you've done 'integer i', so when you assign to i it will > be evaluated as a math expression. Try "echo ${(t)i}". "unset i" > before the loop should fix it. >