[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [shell-script] Comando sed
From: |
Flavio Torres |
Subject: |
Re: [shell-script] Comando sed |
Date: |
Wed, 03 Jun 2009 23:26:33 -0300 |
User-agent: |
Thunderbird 2.0.0.21 (Windows/20090302) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Anderson Nascimento wrote:
> Lista,
>
> Estou batendo a cabeça para remover determinadas linhas de um arquivo.
>
> Seguinte.
>
> tenho um arquivo que tem o seguinte conteudo.
>
> Sun Nov 23 06:32:10 2008 1055 xxx.xxx.xxx.xxx. TCP_MISS/200 198395 GET
> http://www.uol.com.br - DIRECT/200.221.2.45 text/html
> Sun Nov 23 06:37:10 2008 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154 GET
> http://www.uol.com.br - DIRECT/200.98.249.120 text/html
>
>
> Então queria pegar apagar todas as ocorrencias de 2008 por exemplo desse
> arquivo.
>
>
> Li o man de sed mais não rolou nada.
hmmm....Leu mesmo?
debian:~# cat arq.txt
Sun Nov 23 06:32:10 2008 1055 xxx.xxx.xxx.xxx. TCP_MISS/200 198395
GET http://www.uol.com.br - DIRECT/200.221.2.45 text/html
Sun Nov 23 06:37:10 2019 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154
GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html
Sun Nov 23 06:37:10 2008 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154
GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html
Sun Nov 23 06:37:10 2009 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154
GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html
Sun Nov 23 06:37:10 2009 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154
GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html
debian:~# sed '/2008/d' arq.txt
Sun Nov 23 06:37:10 2019 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154
GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html
Sun Nov 23 06:37:10 2009 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154
GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html
Sun Nov 23 06:37:10 2009 1255 xxx.xxx.xxx.xxx TCP_MISS/200 198154
GET http://www.uol.com.br - DIRECT/200.98.249.120 text/html
...skipping...
d Delete pattern space. Start next cycle.
[]'s
- --
/*---------------------------------------------------*/
/* * Flavio Torres - Administrador de Sistemas*/
/* /_\ */int y,z;main(x){x=(x>0?-9:x);z=((z=(x+5)
/* o. .o */)>0?z:-z);printf(!x&&++y?"\n":z?z>y%3+y/
/* ((Y)) */3?" ":x<-5?"/":"\\":y?"|":"*");y-9?main(
/* ()) (() */++x):puts(" _|_|_")&&puts(" \\___/");}
/* ()^() A party animal isn't just for Christmas.*/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
iEYEARECAAYFAkonMNkACgkQNRQApncg29712ACg7fIzszFqDm9+ikuFfgSvb/5O
x6oAoN8+QuoKnkC4vqGluE+EFp3+7tht
=ytaB
-----END PGP SIGNATURE-----