Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!burl!codas!mtune!mtuxo!ras1 From: ras1@mtuxo.UUCP Newsgroups: comp.unix.questions Subject: Re: sed - match newlines on input (Oops+Fix) Message-ID: <2542@mtuxo.UUCP> Date: Wed, 11-Mar-87 20:49:04 EST Article-I.D.: mtuxo.2542 Posted: Wed Mar 11 20:49:04 1987 Date-Received: Fri, 13-Mar-87 00:38:40 EST References: <570@hao.UCAR.EDU> Organization: AT&T Information Systems Labs, Holmdel NJ Lines: 24 >> s/one\ntwo\nthree/one, two, three/g The previously posted examples fail for: ... OR ... abc abc abc 123 123 abc xyz 123 ... xyz ... # A "better" approach might be: sed -n " :top /^abc$/{h; n /^123$/!b top {H; n; /^xyz$/!b top H; g; s/\n/, /gp;} }" ${*:-} #enuf grotesque mucking around w/sed:-) Dick Stewart; ihnp4!tarpon!stewart; ATT-IS: DISCLAIMER !!!