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

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

sed, replace de bloco...


From: Jorge Pereira
Subject: sed, replace de bloco...
Date: Fri, 29 May 2009 17:34:32 -0300

Bem,

Eu tenho em um determinado texto tal trecho abaixo.

ADD_LIBRARY(mylib SHARED
            A.cpp
            B.cpp
            C.cpp
           )

e preciso que fique

@ADD_LIBRARY(mylib SHARED
            A.cpp
            B.cpp
            C.cpp
           )#

tentei algo como

[jpereira@shinobi dir]$ cat /tmp/a
ADD_LIBRARY(mylib SHARED
            A.cpp
            B.cpp
            C.cpp
           )
[jpereira@shinobi dir]$ cat /tmp/a | sed '/^ADD_LIBRARY/,/)/{
s/\(.*\)/#\1#/g}'
#ADD_LIBRARY(mylib SHARED #
#            A.cpp#
#            B.cpp#
#            C.cpp#
#           )#
[jpereira@shinobi dir]$

Alguém tem alguma sugestão!?

thanks!
--
Regards,
+--------------------------------------------+
Jorge Pereira,
http://blog.jorgepereira.com.br/
+--------------------------------------------+


[As partes desta mensagem que não continham texto foram removidas]



reply via email to

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