gno/usr.bin/awk/tests/out2/parser.out
tribby 0b6d503134 awk 2.0 for GNO/ME, including modified Bell Labs source code, test cases,
and output files for test case comparison. See README.gno for implementation
notes. NOTE: some test cases in tests/dotests are commented-out because
they depend on pipes working and/or the "sort" utility.
1998-04-07 16:19:01 +00:00

17 lines
366 B
Plaintext

assign(x, num((float)0));
assign(y, num((float)1));
while (getrec()) {
if (eval(">", field(num((float)1)), x)) {
if (eval("==", x, eval("+", y, num((float)1)))) {
assign(x, num((float)1));
assign(y, eval("*", x, num((float)2)));
} else {
print(x, array(z, x));
}
}
if (eval(">", NR, num((float)1))) {
print(field(num((float)1)));
}
}
print(NR);