*BSD News Article 70491


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!spool.mu.edu!agate!howland.reston.ans.net!nntp.coast.net!news.kei.com!news.mathworks.com!tank.news.pipex.net!pipex!iol!gate.ohs.ie!usenet
From: steveo@gate.ohs.ie (Steve O'Hara-Smith)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: [S]: Script
Date: 2 Jun 1996 16:59:33 GMT
Organization: Steve O'Hara-Smith
Lines: 31
Sender: root@gate.ohs.ie (Steve O'Hara-Smith)
Message-ID: <4osh9l$st4@gate.ohs.ie>
References: <xorMtMD4F99aRz1@borki.zug.use.ch>
NNTP-Posting-Host: dialup-388.dublin.iol.ie
X-Newsreader: knews 0.9.6

In article <xorMtMD4F99aRz1@borki.zug.use.ch>,
	BORKI@zug.use.ch  (Reto Burkhalter) writes:
>Hy Everyone... 
> 
> 
>I'm looling for a shell script or command line syntax in 
>order to delete lines in a file with a specific content. 
>I want to delete member entries in a database without having 
>to invoke an editor. 
> 
>e.g. database file 
> 
>foo xxyy 
>bar yyzz 
>sec zzaa 
> 

Try

	grep -v foo database > database.new
	mv database.new database

Or even
	mv database database.bak
	grep -v foo database.bak > database

-- 
-------------------------------------------------------------------------------
Steve O'Hara-Smith
E-Mail: steveo@iol.ie