$query = `netstat -ntu | awk '{print \$4}' | sort -nr`; while(<$query>) { ($num, $ip) = split(' '); print "output: $num $ip\n"; }