The UNIX and Linux Forums  

Go Back   UNIX e Linux Forum > Inizio Forum > UNIX for Dummies Domande & Risposte
.
google unix.com



UNIX for Dummies Domande & Risposte Se non sei sicuro dove pubblicare un UNIX o Linux domanda, posta da qui. Tutti i neofiti di Linux e UNIX benvenuto!

Più di UNIX e Linux Forum Argomenti potreste trovare utili
Filo Thread Starter Forum Risposte Ultimo Post
Indurre a scambiare su Solaris dangral SUN Solaris 2 03-06-2008 06:12 PM
Swapping Esaia SuSE 3 06-11-2006 05:09 PM
come arrivare a scambiare informazioni leo UNIX for Dummies Domande & Risposte 2 05-06-2004 05:30 PM
Cercapersone e Swapping ST2000 Filesystem, memoria e dischi 2 04-30-2004 03:47 PM
Swapping domande 98_1LE UNIX for Dummies Domande & Risposte 1 08-07-2001 12:43 PM

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 Cerca in questo Thread Rate Thread Modalità di visualizzazione
  #1 (permalink)  
Old 06-24-2009
Jahn Jahn is offline
Utente Registrato
  
 

Iscriviti Data: maggio 2009
Interventi: 9
Swapping nel VI

Salve,

Sono il tentativo di sostituire parecchi simili parole con un'altra parola VI. Ecco quello che ho scritto per lo script:

3dTcat-prefix 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


Quello che voglio fare è sostituire la "stats.J * + tlrc" con "displayBriks". Sono la familiarità con l'utilizzo di: s / comando per trovare e sostituire parecchi identiche parole, ma sono sicuro di come eseguire questa operazione per una espressione regolare in VI. Qualche idea su dove iniziare?

Grazie,

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

Iscriviti Data: dicembre 2003
Luogo: Florida
Interventi: 1.945
Forse un esempio potrebbe aiutarvi. Supponiamo di avere i seguenti file di testo

Codice:
abcdefg
faaaag
accxxcck
abbde

e si desidera utilizzare VI per cercare e sostituire tutte le istanze di 'b', 'c', 'd' ed 'e' con 'Q',
si può fare con il seguente comando:% s / [essere] / D / g 'che si traduce in

Codice:
aQQQQfg
faaaag
aQQxxQQk
aQQQQ

Ecco un tipico, ad eccezione di una VI pagina man di sostituire per quanto riguarda:

Codice:
    [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

Segnalibri

Thread Tools Cerca in questo Thread
Cerca in questo Thread:

Ricerca Avanzata
Modalità di visualizzazione Vota questo thread
Vota questo thread:

Distacco regolamento
Tu non può post nuovo thread
Tu non può inviare una risposta
Tu non può postare allegati
Tu non può modificare i tuoi post

BB codice è Su
Smilies sono Su
[IMG] codice Su
Codice HTML è Chiuso
Trackbacks sono Su
Pingbacks sono Su
Refbacks sono Su




Tutti gli orari sono GMT -4. La data di oggi è 01:12 PM.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Limited. Traduzioni Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
UNIX e Linux Forum Content Copyright © 1993-2009. Tutti i diritti Reserved.Ad di gestione da RedTyger

Contenuti pertinenti URL da vBSEO 3.2.0