From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Fri, 5 Mar 2010 08:41:08 +0000 Message-ID: From: roger peppe To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] sed Q Topicbox-Message-UUID: e088cb24-ead5-11e9-9d60-3106f5b1d025 i don't quite see what you're trying to do here. it's doing what you're asking - but that's a no-op, because N includes an embedded newline. you can do: sed -e '/]/N' -e 's/\n//' if you want to join the lines. or something like this: sed ':x /]$/{ N s/\n/ / t x }' if you want it to work for more than two consecutive lines. On 5 March 2010 07:17, Peter A. Cejchan wrote: > hi, > i would like to append next line if current ends with ']' > however > > =C2=A0 =C2=A0 sed '/\]$/N' foo > > does not work... > ++pac > >