Olá, Fazendo na correria saiu isso aqui, mas acho q também tá dando uma volta bem maior do que o necessário:
$ awk /Interesting/'{ print $4 ; getline; getline; getline; print $3}' resultado.txt | tr "\n" "-" | sed -e 's/:-/ /g' -e's/-/\n/g' 192.168.0.195 00:15:F2:31:21:87 192.168.0.197 00:18:F3:18:10:4C 192.168.0.202 00:1E:8C:CD:8A:E4 Abs, André Saunite 2009/6/16 Marcelo <marc...@fm.usp.br> > > > Olá, > > Tenho o seguinte resultado de um arquivo texto: > > more resultado.txt > > Interesting ports on 192.168.0.195: > PORT STATE SERVICE > 445/tcp open microsoft-ds > MAC Address: 00:15:F2:31:21:87 (Asustek Computer) > > Interesting ports on 192.168.0.197: > PORT STATE SERVICE > 445/tcp filtered microsoft-ds > MAC Address: 00:18:F3:18:10:4C (Asustek Computer) > > Interesting ports on 192.168.0.202: > PORT STATE SERVICE > 445/tcp open microsoft-ds > MAC Address: 00:1E:8C:CD:8A:E4 (Asustek Computer) > > Preciso pegar somente ip e mac-address e gerar um resultado2.txt como > abaixo: > > more resultado2.txt > > 192.168.0.195 00:15:F2:31:21:87 > 192.168.0.197 00:18:F3:18:10:4C > 192.168.0.202 00:1E:8C:CD:8A:E4 > > Estou tentando com "fgrep" "paste", mas acredito que estou dando uma > volta muito grande > e deve haver um jeito muito mais inteligente e facil de obter este > resultado. > > Desde ja Agradeco, > Marcelo > > ---------------------------------------------------------- > Esta mensagem pode conter informacao confidencial. > Se voce nao for o destinatario ou a pessoa autorizada a receber > esta mensagem, nao podera usar, copiar ou divulgar as informacoes nela > contidas ou tomar qualquer acao baseada nessas informacoes. Se > voce recebeu esta mensagem por engano, favor avisar imediatamente o > remetente, respondendo o e-mail e, em seguida, apague-o. > Agradecemos sua cooperacao. > > This message may contain confidential information. > If you are not the addressee or authorized person to receive it for the > addressee, you must not use, copy, disclose or take any action based on > this message or any information herein. If you have received this message > in error, please advise the sender immediately by replying this e-mail > message and delete it. > Thanks in advance for your cooperation. > ---------------------------------------------------------- > Faculdade de Medicina USP > ---------------------------------------------------------- > >