Re: grep and delete
On Fri, Apr 25, 2003 at 10:32:04PM +0200, Emmanuel Lacour wrote:
> On Fri, Apr 25, 2003 at 02:20:25PM +0200, Olivier Macchioni wrote:
> > ++ 25/04/03 13:44 +0200 - Craig:
> > >Hi Guys
> > >
> > >I need to grep log files and delete certain criteria. Any ideas
> > >and how I can do this ?
> >
> > cat logfile | grep -v criteria1 | grep -v criteria2 > logfile.new
> >
>
> grep -Ev "criteria1|criteria2" > logfile.new
>
Ouch:
grep -Ev "criteria1|criteria2" logfile > logfile.new
^^^^^^^
--
Emmanuel Lacour ------------------------------------ Easter-eggs
44-46 rue de l'Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 41 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com
Reply to: