test/symtab9.awk
raw| 1 | BEGIN { |
| 2 | file = "testit.txt" |
| 3 | for (i = 1; i <= 3; i++) |
| 4 | print("line", i) > file |
| 5 | close(file) |
| 6 | |
| 7 | ARGV[1] = file |
| 8 | ARGC = 2 |
| 9 | |
| 10 | for (i = 1; i <= 3; i++) |
| 11 | getline |
| 12 | |
| 13 | printf "NR should be 3, is %d\n", SYMTAB["NR"] |
| 14 | |
| 15 | # Can't do this here. Windows doesn't let you remove a file that |
| 16 | # is still open. Moving it to END won't help either, since the file |
| 17 | # (correctly) remain open until after the END finishes. |
| 18 | # system("rm testit.txt") |
| 19 | } |