I get this syntax error with my code – I’ve tried putting the quotes in various places but no luck. Can someone please assist. Thanks!
awk: non-terminated string | grep Re... at source line 1
context is
>>> <<<
awk: giving up
source line number 2
awk '/ (TCP|UDP) / { split($5, addr, /:/);
cmd = "/bin/geoiplookup " addr[1] | grep 'Rev 1:' | sed 's/Rev 1: //g' " | awk -F', ' '{print $4",", $3",", $2}';
cmd | getline rslt;
close(cmd);
print $1, $2, $3, $4, $5, $6, rslt }' < "$IP_PARSED" >> "$BlockedIPs"
I think we’ve been here before. Don’t try to do complex processing inside the
cmd. Use it to run your external command, then do the processing inside the main AWK program.