sxh@homxc.UUCP (S.HARAN) (01/15/87)
First, does anyone know if there is a more current version of awk than the June, 1985 release? And where it can be obtained? Failing that, can anyone explain the bug? in the June, 1985 release relating to variable pre-definition? The following is a datafile and awk script that illustrates the bug. --------------------------data file------------------------ cik.bk/cikinout.d/attcik.c schedule(attcik1, GREEN, or1(NextStep, TIMEOUT(THIRTYSEC))); cik.bk/cikinout.d/chkcikfmt.c cik.bk/cikinout.d/cikhandler.c schedule (cikbncchk, BLUE, TIMEOUT(2)); schedule(dofill0a, GREEN, or1(NextStep, TIMEOUT(TENSEC))); --------------------------awk script------------------------ awk ' BEGIN { dumb1 = 0; dumb2 = "1234567890"; } /\.bk/ { file = $1; print file; next; } /schedule/ { parms = substr($0, 8); tp = index($0, "TIMEOUT"); print tp; print parms; next; } ' $1 ----------------end of script---------------------- When I set dumb1 and dumb2, as shown, my script produces bad output. However if I #comment out either or both dumb-assignment lines, I get the expected output. As, neither dumb variables are referenced anywhere else in my awk script why should setting two unused variables like this have such an affect? I'ld be grateful for any insights into this. Stephen Haran, homxc!sxh