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 <tyap...@gmail.com> wrote: > hi, > i would like to append next line if current ends with ']' > however > > sed '/\]$/N' foo > > does not work... > ++pac > >