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] Opposite of Cat >>

[ILUG] Opposite of Cat >>

Stephen_Reilly at dell.com Stephen_Reilly at dell.com
Mon Jun 10 16:37:09 IST 2002


	'course another easy way of doing it would be to have a marker at
the end of each line. For example:
99,RestartStyleHint=3 #installfile
99,Priority=1 #installfile
99,RestartCommand=killall ooqstart  #installfile

then do "sed '/#installfile/d' filename" or "grep -v #installfile filename".


	Other than that to delete specific lines (having their line number
is handy) "sed '12,16d' filename" will remove lines 12 to 16 inclusive.
A full thing though not pretty would be...

sed `grep -n begin filename | cut -f1 -d:`,`grep -n end filename | cut -f1
-d:`d filename

steve

-----Original Message-----
From: Niall Sheridan [mailto:niall.sheridan at ormsby-rhodes.ie]
Sent: 10 June 2002 16:10
To: Stephen_Reilly at exchange.dell.com
Cc: ilug at linux.ie
Subject: Re: [ILUG] Opposite of Cat >>


On Mon, 10 Jun 2002 08:48:31 -0500
Stephen_Reilly at dell.com wrote:

> Why not have a backup of all modified files. Then for uninstall overwrite
> with original.
Configuration files can change significantly at any point in time between
the install and uninstall.

Niall

> steve
> 
> -----Original Message-----
> From: Stephen Shirley [mailto:diamond at skynet.ie]
> Sent: 10 June 2002 14:22
> To: Irish Linux Users Group
> Subject: Re: [ILUG] Opposite of Cat >>
> 
> 
> On Mon, Jun 10, 2002 at 12:57:06PM +0100, Brian Foster wrote:
> >  this is trivial to un-install --- just delete all lines
> >  between (and including) the two magic marker lines.
> >  numerous tools can do this, sed(1) is perhaps a good
> >  choice 
> 
> I'm just wondering, could you give a snippet of sed code to demonstrate
> this? I've used sed for line editing lots of times, but anything more
> complex, and the man page maketh no sense to me. I've even tried looking
> for example sed scripts on the sed homepage, but no joy. Therefore, for
> this sort of thing, i'd use sed, cause i know how -)
> 
> Steve
> -- 
> "Oh look, it's the Pigeon of Love."
> 
> -- 
> Irish Linux Users' Group: ilug at linux.ie
> http://www.linux.ie/mailman/listinfo/ilug for (un)subscription
information.
> List maintainer: listmaster at linux.ie
> 
> -- 
> Irish Linux Users' Group: ilug at linux.ie
> http://www.linux.ie/mailman/listinfo/ilug for (un)subscription
information.
> List maintainer: listmaster at linux.ie




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