#!/bin/bash while true; do sudo netstat -tp --numeric-ports ; done |awk -W interactive '/:80/&&$7!="-" { if (!( ($4,$5) in a) ) { print $4,$5,$7,$8; a[$4,$5] = $7; } }' >log