combing two lines

Hi list,

I have to combine two lines and adding the " - " in between.

So:
Here's sentence A
Here's Senctence B

Here's sentence A - Here's Senctence B

I know how to us SED: sed '$!N;s/\n/ /' for combining tow lines. But how do
I insert the " - " correctly?

Thanks!

Martijn
(os 10.5.6, bash)

 $ ruby -0777 -ne 'print $_.split("\n").join(" - ")' file 

Hi,

I think you were in the point. I copied your sentence adding the '-' char.

$ sed '$ !N; s/\n/ - /' infile

Regards,
Birei

i would do..

a='sentence a'
b='sentence b'
c="${a} - ${b}"
echo ${c}

H guys,
thanks for all the suggestions. many roads to follow..
I have a look at them.
cheers
martijn