Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Strange behavior with "for i in .."
- X-seq: zsh-users 16406
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Strange behavior with "for i in .."
- Date: Fri, 23 Sep 2011 12:43:58 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s1024; t=1316774639; bh=H7jhBH3ly8WDKwY8/w400SsRkkl2VzggUMUKxYlpqH8=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:In-reply-to:From:References:To:Subject:Date:Message-ID; b=CcAPYM0sv2eMJNQYeW0T5mlgr/WJZ4XYm5AYpR5P6l5Npy3WRi+et7bpVQcRfR93AhdHuk9SEi1KwU4ull0Mg2SeEhvTkQLm1pguJHOEwLx0pnSV7oIcNXRRnvJq0X/rtWP1f5AAF87ki1nsI/HarfFSVN8u4h77MNm7NNbciLs=
- In-reply-to: <4E7C5F9D.2070308@gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <4E7C5F9D.2070308@gmail.com>
Volodya Khomchak wrote:
> 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...'
the i variable has somewhere been declared as an integer type. For
example with a command such as:
typeset -i i
or more likely in a math expression such as:
(( i = 1 ))
You can verify this by doing:
typeset -p i
or if you prefer:
echo ${(t)i}
You can use typeset +i i to remove the integer type. However, you may
want to check where it is being set. There might be a shell function
that should have declared i local.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author