zsh-users
 help / color / mirror / code / Atom feed
* for x in * evaluates filenames as arithmetic expressions?
@ 2005-05-24 10:36 Einar Huginson
  2005-05-24 10:51 ` Peter Stephenson
  0 siblings, 1 reply; 4+ messages in thread
From: Einar Huginson @ 2005-05-24 10:36 UTC (permalink / raw)
  To: zsh-users

When executed in a directory containing files with names such as

	2004-10-22.txt
	2004-10-29.txt
	...

a ZSH command of

	for x in *
	do
		echo $x
	done

fails with

	zsh: bad math expression: operator expected at `txt'

Thus, it appears that the wildcard is erroneously evaluated as arithmetic 
expression. This is confirmed by

	for x in 9-5
	do
		echo $x
	done

, which outputs
	
	4

This behavior differs significantly from that of other shells. Is there any 
way to turn it off? So far, the only way I have found to process such 
directories is to use BASH instead of ZSH.

Any hints are appreciated,
  Andreas Koch


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-05-24 11:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-24 10:36 for x in * evaluates filenames as arithmetic expressions? Einar Huginson
2005-05-24 10:51 ` Peter Stephenson
2005-05-24 11:21   ` Einar Huginson
2005-05-24 11:36     ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).