Nonstandard Getline behavior
Brought to you by:
ddaglas
getline function changes variables that it should not according to http://www.gnu.org/software/gawk/manual/html_node/Getline-Summary.html#Getline-Summary
I used the function in the form
command | getline var
but at least FILENAME and NF were changed. For my application of the type
/pattern/ {
cmd = "wget -t 1 -nv " $1 " 2>&1"
while ( (cmd | getline line) > 0 )
result = result " " line
close(cmd)
}
it had the consequence of stopping the awk script after processing one line of the input file instead of processing each line. The script works correctly with Gawk.
I have a fix resolving the issue. How can I contribute to the source?