shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [shell-script] Substituição de palavra


From: Evandro Couto
Subject: Re: [shell-script] Substituição de palavra
Date: Thu, 27 Feb 2014 11:05:09 -0300
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0




for i in `cat teste.txt | awk '{print $5}'` ; do  sed -i s/$i/teste/g teste.txt; done


Evandro Couto
Skype: tutoriaisgnulinux
TutoriaisGnuLinux.com


Em 27-02-2014 10:17, Tiago Peczenyj escreveu:
 
use sed s/registro/registroNovo/g se vc nao tem nenhuma outra ocorrencia da string 'registro' no seu arquivo.

se tiver vamos ter que fazer algo mais elaborado.


2014-02-27 9:04 GMT-03:00 M. Rodrigo Monteiro <address@hidden>:
 
Caros, bom dia!

Estou fazendo uma manutenção em um DNS, e nele o padrão é o seguinte:

dominio TAB numero TAB IN SOA TAB registro email numero numero numero numero

Eu queria alterar em todas as linhas o segundo registro. Ou seja, que fique assim:

dominio TAB numero TAB IN SOA TAB registroNOVO email numero numero numero numero


Um exemplo real
brazilmarket.net.                             86400 IN SOA      brazilmarket.net. root.brazilmarket.net. 2000041302 3600 900 900000 86400

M. Rodrigo Monteiro
    
"Free as in Freedom, not free as in free beer"
"As we are liberated from our own fear, our presence automatically liberates others"
Linux User # 403730

Pense antes de imprimir. Think before printing.

AVISO LEGAL
Esta mensagem é destinada exclusivamente para a(s) pessoa(s) a quem é dirigida, podendo conter informação confidencial e/ou legalmente privilegiada. Se você não for destinatário desta mensagem, desde já fica notificado de abster-se a divulgar, copiar, distribuir, examinar ou, de qualquer forma, utilizar a informação contida nesta mensagem, por ser ilegal. Caso você tenha recebido esta mensagem por engano, pedimos que nos retorne este E-Mail, promovendo, desde logo, a eliminação do seu conteúdo em sua base de dados, registros ou sistema de controle. Fica desprovida de eficácia e validade a mensagem que contiver vínculos obrigacionais, expedida por quem não detenha poderes de representação.

LEGAL ADVICE
This message is exclusively destined for the people to whom it is directed, and it can bear private and/or legally exceptional information. If you are not addressee of this message, since now you are advised to not release, copy, distribute, check or, otherwise, use the information contained in this message, because it is illegal. If you received this message by mistake, we ask you to return this email, making possible, as soon as possible, the elimination of its contents of your database, registrations or controls system. The message that bears any mandatory links, issued by someone who has no representation powers, shall be null or void.




--
Tiago B. Peczenyj
Linux User #405772

http://about.me/peczenyj


reply via email to

[Prev in Thread] Current Thread [Next in Thread]