From epement@jpusa.chi.il.us Tue Aug 5 16:49:44 1997 Path: fu-berlin.de!news-ber1.dfn.de!news-fra1.dfn.de!news-kar1.dfn.de!news-was.dfn.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntprelay.mathworks.com!news.mathworks.com!chi-news.cic.net!ddsw1!news.mcs.net!not-for-mail From: Eric Pement Newsgroups: comp.editors Subject: Re: SED: OR and AND Date: Sat, 26 Jul 1997 14:47:32 -0600 Organization: MCSNet Services Lines: 21 Distribution: inet Message-ID: <33DA6264.90B10ACC@jpusa.chi.il.us> References: NNTP-Posting-Host: jpusa-6.pr.mcs.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.01 [en] (Win95; I) To: Paul Lunney X-Priority: 3 (Normal) (courtesy copy sent via e-mail) Paul Lunney wrote: > > Could anyone give me some pointers as to how to make SED print out the > following in 2 runs: > > 1. lines of a file that contain _either_ the words 'missing' OR 'outlier' sed -e '/missing/b' -e '/outlier/b' -e d filename # standard sed versions sed '/missing/b;/outlier/b;d' filename # GNU sed > 2. lines of a file that contain _both_ the words 'missing' AND 'outlier' > in any order sed '/missing/!d;/outlier/!d' filename # all versions Eric Pement