Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site tektools.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!uw-beaver!tektronix!tektools!jerryp From: jerryp@tektools.UUCP (Jerry Peek) Newsgroups: net.unix Subject: Re: Putting in newlines using sed Message-ID: <557@tektools.UUCP> Date: Mon, 18-Nov-85 11:22:08 EST Article-I.D.: tektools.557 Posted: Mon Nov 18 11:22:08 1985 Date-Received: Wed, 20-Nov-85 00:49:26 EST References: <376@bcsaic.UUCP> Reply-To: jerryp@tektools.UUCP (Jerry Peek) Organization: Tektronix, Beaverton OR Lines: 24 Keywords: sed Summary: In article <376@bcsaic.UUCP> michaelm@bcsaic.UUCP (michael b maxwell) writes: > This is on BSD 4.2... > I have a process putting out lines that look something like this: > fjlkjf foo (a b c) jflkjf (jfkj) foo (x y a) fjjfj > I want to break up the line so that each "foo" followed by its > parenthesized list of arguments appears on a separate line. I don't > care what happens to the other "words;" they are eliminated in > later processing. In Bourne shell: sed 's/foo/\ foo/g' In C-shell, you'll need a second backslash: sed 's/foo/\\ foo/g' --Jerry Peek, UNIX Training Instructor, Tektronix, Inc. US Mail: MS 74-222, P.O. Box 500, Beaverton, OR 97077 uucp: {allegra,decvax,hplabs,ihnp4,ucbvax}!tektronix!tektools!jerryp CS,ARPAnet: jerryp%tektools@tektronix.csnet Phone: 503/627-1603