bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gawk's "for" does not allow simple-statements.


From: David Jones
Subject: gawk's "for" does not allow simple-statements.
Date: Mon, 07 Jan 2002 13:46:33 +0000

In a for statement:

for(x;;y)

x and y are both allowed to be simple_statement (in the single unix spec
Version 2, but also in the IEEE P1003.1, Draft 7, Issue 6).

That means the following ought to work (outputting "9\n").

./gawk 'BEGIN{for(print 9;0;);}'

but it doesn't (I get parse error).

Cheers,
 drj

# versions etc
$ ./gawk --version
GNU Awk 3.1.0
$ uname -a
FreeBSD topcat.zoonami.com 4.3-RELEASE FreeBSD 4.3-RELEASE #0: Thu Nov  1 
14:13:13 GMT 2001     address@hidden:/usr/src/sys/compile/GENERIC  i386



reply via email to

[Prev in Thread] Current Thread [Next in Thread]