[OT] replace a word with a multiline with sed

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

 



Hello,
sorry for the offtopic. it seems a simple thing but I can't find an escape char or something correct...
I have this setup in place
source file input.txt:

bla bla
bla bla
TAG
bla bla

sed command file sed.txt:

/TAG/c\
BLABLA .... BLABLA

so that the command
sed -f sed.txt input.txt
gives as output

bla bla
bla bla
BLABLA .... BLABLA
bla bla

Suppose I want now to substitute the TAG pattern with a multi-line pattern, for example
occurences of
TAG
must become 2 lines:
BLABLA
BLOBLO

How can I achieve this?
Thanks in advance,

Gianluca
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux