Xref: utzoo comp.unix.wizards:18052 comp.unix.questions:16221 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!dptg!ulysses!andante!alice!wcs From: wcs@alice.UUCP (Bill Stewart, usually) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: Joining Lines in SED ? Message-ID: <9868@alice.UUCP> Date: 8 Sep 89 14:29:19 GMT References: <3559@cbnewsh.ATT.COM> Reply-To: wcs@alice.UUCP (Bill Stewart, usually) Distribution: na Organization: AT&T Bell Labs, Holmdel NJ Lines: 21 In article <3559@cbnewsh.ATT.COM> wcs@cbnewsh.ATT.COM (Bill Stewart 201-949-0705 ho95c.att.com!wcs) writes: :how to join lines using sed? Thanks to those of you who replied. The answer was to do N # append next input line to pattern space s/\n// # trash the newline It halfway worked. The subtlety about this is the order in which sed-commands are executed. When I executed sed -e 's/old/new/' -e '/joinme/N' -e 's/\n/ /' <