The UNIX and Linux Forums  

Go Back   El UNIX y Linux Foros > Arriba Foros > UNIX for Dummies Preguntas y Respuestas
.
google unix.com



UNIX for Dummies Preguntas y Respuestas Si no está seguro de que para publicar un UNIX o Linux cuestión, puesto que aquí. Todos los novatos en Linux, UNIX y bienvenida!

Más UNIX y Linux Foro Temas usted puede encontrar útiles
Hilo Hilo para principiantes Foro Respuestas Último mensaje
Inducir el intercambio en Solaris dangral Sun Solaris 2 03-06-2008 06:12 PM
Swapping Esaia SuSE 3 06-11-2006 05:09 PM
cómo intercambiar información leo UNIX for Dummies Preguntas y Respuestas 2 05-06-2004 05:30 PM
Buscapersonas y Swapping ST2000 Sistemas de ficheros, memoria y discos 2 04-30-2004 03:47 PM
Intercambio de preguntas 98_1LE UNIX for Dummies Preguntas y Respuestas 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 vínculo Herramientas de hilo Buscar en este Hilo Tasa de Hilo Modos de visualización
  #1 (Enlace permanente)  
Old 06-24-2009
Jahn Jahn is offline
Usuario Registrado
  
 

Fecha: mayo 2009
Mensajes: 9
Swapping en editor VI

Hola,

Estoy tratando de sustituir con varias palabras similares en otra palabra vi. Esto es lo que he escrito para el script:

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


Lo que quiero hacer es sustituir a la "stats.J * + tlrc" por "displayBriks". Estoy familiarizado con el uso de la: s / comando para buscar y reemplazar varias palabras idénticas, pero estoy seguro de cómo hacer esto por una expresión regular en vi. Alguna idea sobre por dónde empezar?

Gracias,

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

Fecha: diciembre 2003
Ubicación: Florida
Puestos: 1.930
Quizás un ejemplo podría ayudarle. Suponga que tiene el siguiente archivo de texto
Código:
abcdefg
faaaag
accxxcck
abbde
y desea utilizar vi para buscar y reemplazar todas las instancias de 'b', 'c', 'd' y 'e' por 'Q',
que se puede hacer con el siguiente comando:% s / [se] / Q / g 'que se traduce en
Código:
aQQQQfg
faaaag
aQQxxQQk
aQQQQ
Aquí está uno, excepto a partir de una típica vi hombre con respecto a la página de sustitución:
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

Herramientas de hilo Buscar en este Hilo
Buscar en este Hilo:

Búsqueda avanzada
Modos de visualización Vota a este hilo
Vota a este hilo:

Normas de envío
puede que no nuevo puesto de hilos
puede que no enviar respuestas
puede que no enviar archivos adjuntos
puede que no editar sus puestos

Código BB es Encendido
Emoticones son Encendido
[IMG] código Encendido
Código HTML es Apagado
Trackbacks son Encendido
Pingbacks son Encendido
Refbacks son Encendido




Todas las horas son GMT -4. La hora es 07:16 AM.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Limited. Traducciones de idiomas Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Estudios
El UNIX y Linux Foros Contenido Copyright © 1993-2009. Todos los derechos Reserved.Ad Gestión por RedTyger

Las direcciones URL de contenido vBSEO 3.2.0