The UNIX and Linux Forums  

Go Back   O UNIX e Linux Forum > Top Fóruns > UNIX para Dummies Perguntas & Respostas
.
google unix.com



UNIX para Dummies Perguntas & Respostas Se não tiver certeza de onde se pode postar uma pergunta Unix ou Linux, postá-lo aqui. Todos os UNIX e Linux novatos bem vindos!

Mais UNIX e Linux Fórum Tópicos Você pode achar Helpfull
Fio Thread Starter Fórum Respostas Última postagem
Swapping induzir em Solaris dangral Sun Solaris 2 03-06-2008 06:12
Swapping Esaia SuSE 3 06-11-2006 05:09
como chegar swapping info leo UNIX para Dummies Perguntas & Respostas 2 05-06-2004 05:30
Paginação e Swapping ST2000 Filesystems, Discos e Memória 2 04-30-2004 03:47
Swapping perguntas 98_1LE UNIX para Dummies Perguntas & Respostas 1 08-07-2001 12:43

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
Linkback Thread Tools Pesquisar este Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-24-2009
Jahn Jahn is offline
Usuário
  
 

Join Date: May 2009
Posts: 9
Swapping no editor VI

Oi,

Estou tentando substituir várias palavras semelhantes com outra palavra em vi. Aqui está o que tenho escrito para o script:

3dTcat-prefixo SuperBrik_4WAY_HRF ../JULY10_2007A/results2TENT/stats.JULY10_2007A + tlrc ../JULY10_2007G/results2TENT/stats.JULY10_2007G + tlrc ../JULY10_2007I/results2TENT/stats.JULY10_2007I + tlrc ../JULY11_2007F/results2TENT/stats.JULY11_2007F + tlrc ../JULY11_2007J/results2TENT/stats.JULY11_2007J + tlrc ../JULY12_2007A/results2TENT/stats.JULY12_2007A + tlrc ../JULY12_2007B/results2TENT/stats.JULY12_2007B + tlrc ../JULY12_2007I/results2TENT/stats.JULY12_2007I + tlrc ../JULY12_2007J/results2TENT/stats.JULY12_2007J + tlrc ../JUNE13_2007A/results2TENT/stats.JUNE13_2007A + tlrc ../JUNE13_2007B/results2TENT/stats.JUNE13_2007B + tlrc ../JUNE13_2007C/results2TENT/stats.JUNE13_2007C + tlrc .. / JUNE13_2007E/results2TENT/stats.JUNE13_2007E + tlrc ../JUNE13_2007G/results2TENT/stats.JUNE13_2007G + tlrc ../JUNE13_2007I/results2TENT/stats.JUNE13_2007I + tlrc ../JUNE14_2007D/results2TENT/stats.JUNE14_2007D + tlrc ../JUNE14_2007H / results2TENT/stats.JUNE14_2007H + tlrc ../JUNE15_2007A/results2TENT/stats.JUNE15_2007A + tlrc


O que eu quero fazer é substituir o "stats.J * + tlrc" com "displayBriks". Estou familiarizado com a utilização da: s / comando para localizar e substituir várias palavras idênticas, mas tenho certeza de como fazer isso para uma expressão regular no vi. Qualquer idéia sobre onde começar?

Obrigado,

-Jahn
  #2 (permalink)  
Old 06-24-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderador
  
 

Join Data: dezembro 2003
Localização: Florida
Posts: 1.941
Talvez um exemplo iria ajudá-lo. Suponha que você tenha o seguinte arquivo de texto

Código:
abcdefg
faaaag
accxxcck
abbde

e pretende utilizar vi a pesquisa e substituir todas as instâncias de 'b', 'c', 'd' e 'e' com 'Q',
você pode fazer com o seguinte comando ":% s / [ser] / Q / g ', que resulta em

Código:
aQQQQfg
faaaag
aQQxxQQk
aQQQQ

Aqui está uma excepção de um típico vi página man quanto substituto:

Código:
    [range] s[ubstitute] [/pattern/replace/] [options] [count] [flags]
    [range] & [options] [count] [flags]
    [range] ~ [options] [count] [flags]
        Make substitutions. In the substitution string, the characters ~ and %
        may have special meanings. If the entire replace pattern is a percent
        sign (%), the previous replacement pattern is used. (This can be
        useful for repeating substitutions that contain back references.) The
        special character ~ inserts the previous replacement string into this
        replacement string.
        The options can be any of the following:

        c
            Ask for confirmation before replacing the text.

        g
            Perform the replacement on all occurrences of the regular
            expression on the line.

        r
            If no regular expression was specified, use the most recent
            regular expression (used for a search) rather than the same
            regular expression as used for the last substitute command.

Reply

Marcadores

Thread Tools Pesquisar este Thread
Pesquisar este Thread:

Pesquisa Avançada
Display Modes Esta taxa Thread
Esta taxa Thread:

Destacamento Regimento
Você não pode postar novas threads
Você não pode postar respostas
Você não pode postar anexos
Você não pode editar suas postagens

BB code é Ligado
Smilies são Ligado
[IMG] código é Ligado
Código HTML é Desligado
Trackbacks são Ligado
Pingbacks são Ligado
Refbacks são Ligado




Todos os horários são GMT -4. A hora é agora 04:49.


Powered by: vBulletinCopyright © 2000 - 2006, Jelsoft Enterprises Limited. Língua Traduções Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
O UNIX e Linux Fóruns Content Copyright © 1993-2009. Todos os Direitos Reserved.Ad Gestão por RedTyger

Content Relevant URLs por vBSEO 3.2.0