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

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

Re: [shell-script] Substituir valor em arquivos


From: Junior Barreto
Subject: Re: [shell-script] Substituir valor em arquivos
Date: Mon, 5 Apr 2004 16:13:29 -0300 (ART)

Véio.. vc pode dar um cat no arquivo e depois usar o
SED para fazer a substituição !

Veja soh..

cat /home/user/arquivo_01 | sed
's/PALAVRA_ANTIGA/PALAVRA_NOVA/g'

Eu num testei aqui !!

Mas veja aê e qualquer coisa vc fala.. 


 --- Ricardo Rodrigues <address@hidden>
escreveu: >    Pessoal,
> 
>    Tenho que substituir uma valor em diversos
> arquivos e gostaria de um scritp que
> fizesse isto autaticamente: Segue abaixo exemplo:
> 
>    Verificar se existe nestes arquivos a palavra
> PALAVRA_ANTIGA, caso sim, 
> substitua para PALAVRA_NOVA.
> 
> /home/user/arquivo_01
> /home/user/arquivo_02
> /home/user/arquivo_03
> 
> /usr/var/arqivo_empresa_01
> /usr/var/arqivo_empresa_05
> /usr/var/arqivo_empresa_10
> 
> 
>    Desde já obrigado.
> 
>   _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> |   _                           |
> |  ºVº   Ricardo Rodrigues      |
> | /(_)\  Linux User # 347648    |
> |  ^ ^   address@hidden |
> | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
>  

______________________________________________________________________

Yahoo! Mail - O melhor e-mail do Brasil! Abra sua conta agora:
http://br.yahoo.com/info/mail.html


reply via email to

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