cat test.txt | tr '\n+' ' 'とかどう?