Gerson Haus wrote:
> X-Mailer: YahooMailRC/324.3 YahooMailWebService/0.8.100.260964
> Date: Thu, 1 Apr 2010 13:30:09 -0700 (PDT)
> From: Gerson Haus <haus_c...@yahoo.com.br>
> Subject: grep - última ocorrência
> To: debian-user...@lists.debian.org
>
> Senhores,
>
> Preciso que o grep me retorne somente a última linha de cada arquivo que contém a string Received.
>
> $ grep Received * - retorna todas as ocorrências, porém só quero a última ocorrência em cada arquivo.
>
> Grato,
> Gerson.
>
>
> ____________________________________________________________________________________
> Veja quais são os assuntos do momento no Yahoo! +Buscados
> http://br.maisbuscados.yahoo.com
--
Francisco Aparecido da silva(fafanet)
-------------------------------------
Blog: http://blog.silva.eti.br
Home Page http://silva.eti.br
http://www.twitter.com/fafanete
http://www.identi.ca/fafanet
GNU/Linux user:239412 GPG ID:01BC73D6
-------------------------------------
/\ Document Freedom Day - Liberate your documents
_\/` http://documentfreedom.org/ - March 31st 2010
--
Fabiano Pires
Linux Professional Institute Certified - Level 2
ITIL Foundations Certified
http://pragasdigitais.blogspot.com/
--
To UNSUBSCRIBE, email to debian-user-por...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/z2q11d14faa1004011523sf...@mail.gmail.com
'grep Received * | xargs tail -n 1' ?
--
To UNSUBSCRIBE, email to debian-user-por...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201004011922....@yahoo.com.br
> 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
gunfu...@gmail.com
--
To UNSUBSCRIBE, email to debian-user-por...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/20100401195...@papel.gfcm.net
for a in * ; do grep -H ^Received "$a" | tail -n1 ; done
se quiser tirar o arquivo:Received do resultado, tira o -H.
[ ]s, Henry
--
To UNSUBSCRIBE, email to debian-user-por...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
Archive: http://lists.debian.org/201004012115.1...@yahoo.com.br
Gerson Haus escreveu:
grep Received * | sort -u | grep último$
- --
Flamarion Jorge
OpenPGP Key: 6CA750E1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAku1bbYACgkQ0SDRnmynUOHhoACgzDK4k1mwm/LWDZNVbwFEmTG7
ADwAn0daFI418zHZ+2q/vJclaFreKyqP
=olCo
-----END PGP SIGNATURE-----
--
To UNSUBSCRIBE, email to debian-user-por...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org
No awk, pra mostrar a última coluna se usa '$NF" . ;)
fabricio@maquina:~ # echo "bla blo" | awk '{print $NF}'
blo
[ ]'s
--
To UNSUBSCRIBE, email to debian-user-por...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org