This snip works but there is a long lag time between the last line printed and the termination of the script. I set x but that didnt show me anything. Im wondering why this is happening.
Code:
grep -E 'tcp.*ssh|tcp.*telnet|udp.*snmp|Host is|scan report' fileone | sed -n "/^Nmap.*)$/,/^161/p" zee |\
sed '
s/\(SNMP.*\|OpenSSH.*$\|protocol.*\)//g;
s/^Nmap.*for //g;
s/Host is //g;
s/(.*latency.*$//g;
s/\(.*cp \|.*dp \)//g;
s/\((\|)\)//g;
s/ *$//g' | tr '\012' ',' | sed 's/snmp,/snmp\n/g'