fix awk script, adjust to newer netcat versions

This commit is contained in:
john30
2021-02-14 16:46:46 +01:00
parent c1e7ba5d7e
commit 024bf8435f
+3 -3
View File
@@ -10,7 +10,7 @@ if [ "x$1" = "x-m" ]; then
shift shift
maxidlen=$1 maxidlen=$1
fi fi
echo "grab result"|nc localhost $port|awk -vmaxidlen=$maxidlen ' echo "grab result"|nc -N localhost $port|awk -vmaxidlen=$maxidlen '
BEGIN{ BEGIN{
sdatas[""]=0 sdatas[""]=0
delete sdatas[""] delete sdatas[""]
@@ -27,8 +27,8 @@ BEGIN{
exit exit
} }
/.+/ { /.+/ {
m=gensub(" ", "", "g", gensub("=.*$", "", "", $1)) m=gensub(" ", "", "g", gensub("=.*$", "", 1, $1))
s=gensub(" ", "", "g", gensub("=.*$", "", "", $2)) s=gensub(" ", "", "g", gensub("=.*$", "", 1, $2))
pbsbnnid=substr(m,5,(3+maxidlen)*2) pbsbnnid=substr(m,5,(3+maxidlen)*2)
if (!shorted[pbsbnnid]) { if (!shorted[pbsbnnid]) {
shorted[pbsbnnid]=1 shorted[pbsbnnid]=1