Используйте для этого sed
, как показано ниже:
SHW@SHW:/tmp $ cat a
this is line one
and this is line two
the third and the
fourth must be pasted too
SHW@SHW:/tmp $ sed 'N;s/\n/ /' a -i
SHW@SHW:/tmp $ cat a
this is line one and this is line two
the third and the fourth must be pasted too