I'm trying to massage code so that if it finds any ip address(except 0.0.0.0) in the foreign address column it will print out "foreign address found"
right now, it is printing "foreign address found" due to $5 being a column ..
the default ip in column $5 is 0.0.0.0:*
if there is an easier approach to this, I'm all ears ..
netstat -lntup |grep -i 'listen' | awk '$5{print "foreign address found"}'
foreign address found
foreign address found
foreign address found
foreign address found
foreign address found
Thanks!
right now, it is printing "foreign address found" due to $5 being a column ..
the default ip in column $5 is 0.0.0.0:*
if there is an easier approach to this, I'm all ears ..
netstat -lntup |grep -i 'listen' | awk '$5{print "foreign address found"}'
foreign address found
foreign address found
foreign address found
foreign address found
foreign address found
Thanks!