LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Another Scripting Question...

[ILUG] Another Scripting Question...

A. Dreyer adreyer at math.uni-paderborn.de
Fri Jul 29 11:50:13 IST 2005


Conall O'Brien wrote:
> Hello,
> 
> 
> Since the recent thread on grep seems to be full of useful tips, I
> wonder if anyone can help me with a small issue I have.
> 
> 
> I've a shell script I'm working on to take individual BIND9 zone
> files and transfer them (via ssh) from the master ns to the slave ns, 
> editing them accordingly in transit (using sed).
> 
> 
> 
> My only problem is I'm trying to do a multi line replace in sed 
> 
> 
> eg sed -e 's/notify yes;/notify no;\nmasters { $IP; }/'
> 
> 
> Everything works except for the newline control character I want for
> human readability (sed doesn't like the newline character in the 
> replacement part of the expression.) 
> 
> 
> I've also tried 
> 
> sed -e 's/notify yes;/notify no; \
> masters { $IP; }/'
> 
> 
> to no avail. Any suggestions how I can achieve this replacement?
> 
> 

Hy,

sed -e 's/notify yes;/notify no;@masters { $IP; }/' | tr '@' '\n'


Regards,
A.




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell