I have a data that looks like this
> sq1
foofoofoobar
foofoofoo
> sq2
quxquxquxbar
quxquxquxbar
quxx
> sq3
paxpaxpax
pax
What I want to do is to join them into one lines:
> sq1 foofoofoobarfoofoofoo
> sq2 quxquxquxbarquxquxquxbarquxx
> sq3 paxpaxpaxpax
I tried this code but fail.
sed -e 'te' -e 'H;$!d;:e' -e 'x;/^$/d;s/\n//g'
What's the right way to do it?