Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
função do egrep. duvidass [resolvido]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Portuguese
View previous topic :: View next topic  
Author Message
linker
n00b
n00b


Joined: 19 Jul 2007
Posts: 5

PostPosted: Tue Nov 13, 2007 11:49 am    Post subject: função do egrep. duvidass [resolvido] Reply with quote

Estou tentando editar um arquivo mas ele é enorme. Preciso editar esse arquivo e remover toda a linha que contenha uma determinada espressão.

Por exemplo: no manual de instalação do squid ninja ha um exemplo de lempeza do squid.conf.

egrep -v "^#|^$" squid.conf.original > squid.conf

Pelo que o autor diz, esse comando retira todos os comentarios.

Alguem pode me explicar o significado disso: "^#|^$" ??

Obrigado

abraçoss


Last edited by linker on Fri Nov 16, 2007 12:06 pm; edited 1 time in total
Back to top
View user's profile Send private message
hmbr
n00b
n00b


Joined: 27 Nov 2006
Posts: 31
Location: Brasilia-DF-Brazil

PostPosted: Tue Nov 13, 2007 11:38 pm    Post subject: Reply with quote

simples

o -v é para ignorar as linhas que batam com a expressão
a regex é simples, o ^ indica comeco de linha, ou seja, ele vai remover todas as linhas que comecem com # ou $

[]'s
Back to top
View user's profile Send private message
linker
n00b
n00b


Joined: 19 Jul 2007
Posts: 5

PostPosted: Fri Nov 16, 2007 12:05 pm    Post subject: Reply with quote

Beleeezaa. Obrigado hmbr =]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portuguese All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum