Your frustration is valid, but that is the purpose of writing obfuscated programs. Anyways I think we have beaten this dead animal far too much. It'd have been nice to put the comparison operator instead of the assignment one but since the latter evaluates to true for each line, they're all printed.
There is nothing wrong with the script below, save that it is an example of obfuscated awk scripting.
A = "a"
B = "b"
{
}
END {
print A, B
}
Moreover, it is semantically different from the script that you've posted although it looks syntactically similar to the one you're talking about.
See if this awk command will work for you:
awk '{c[$2]++;l=$0;gsub("^[0-9]+ *[0-9]+ *","",l);pid[$1]=l;ppid[$2]=(ppid[$2]?ppid[$2] " " l : l)}END{for(i in ppid) if (i in pid) {pid[i] = pid[i]" "ppid[i];print i, pid[i]}}' file
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.