Path: utzoo!attcan!uunet!lll-winken!brutus.cs.uiuc.edu!zaphod.mps.ohio-state.edu!mips!apple!oliveb!orc!mipos3!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: a Sed question Message-ID: <1990Feb1.224944.13107@iwarp.intel.com> Date: 1 Feb 90 22:49:44 GMT References: <520@mirsa.UUCP> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 34 In-Reply-To: muller@mirsa.UUCP (Christophe Muller) In article <520@mirsa.UUCP>, muller@mirsa (Christophe Muller) writes: | That might be a stupid question, but does somebody know how to | do that job with "sed" ? I wanted to find all the lines matching a | pattern, delete these lines _and_ the line immediately following. | | After half an hour of tests, man, Unix books, i gave up and used a | small awk script that worked well the first time ! I just thought that | sed might be faster, but is it possible ? (Note: we still don't have | perl...) Foreseeing a possible reply involving Perl means you've been following c.u.q for a while. Well, here's a sed solution: sed '/pattern/{N d }' <