Usa o AWK:
exemplo:
cat rec1.txt |grep -i 'Received' |awk '{print $2}'
O $2 significa mostrar a segunda coluna, que no seu caso seria o "último".
Em 1 de abril de 2010 20:56, Gerson Haus <[email protected]>escreveu:
> Sem o xargs deu sinal de melhoras!
>
> $ grep Received * | tail -n 1
> rec.txt:Received último
>
> Mas só aparece o último "Received" do último arquivo.
>
> Parece que só falta aquele "for 'todos os arquivos' repeat ... alguém está
> com o "shell script" menos enferrujado do que eu?
>
> Grato,
> Gerson.
>
> Em Thu, 1 Apr 2010 19:22:27 -0300,
> Fabricio Cannini <[email protected]> escreveu:
>
> > grep Received * | xargs tail -n 1
>
>
> aqui funcionou sem o xargs
>
> $ history | grep aptitude | tail -n 1
> 507 history | grep aptitude | tail -n 1
>
>
> abraço,
>
> --
>
> "...agora, só nos sobrou o futuro...", visto em www.manuchao.net
>
> Gunther Furtado
> Curitiba - Paran__ - Brasil
> [email protected]
>
>
> --
> To UNSUBSCRIBE, email to [email protected]
> with a subject of "unsubscribe". Trouble? Contact
> [email protected]
> Archive: http://lists.debian.org/[email protected]
>
>
> ------------------------------
> Veja quais são os assuntos do momento no Yahoo! + Buscados: Top
> 10<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/>-
> Celebridades<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/celebridades/>-
> Música<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/m%C3%BAsica/>-
> Esportes<http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/esportes/>
>
--
.~.
/ v \
/( )\ GNU/Debian/Linux
^ ^