sed教程
sed ':a;N;$!ba;s/\n/ /g'
read the whole input in a loop ,then replace '\n' with a space
逐个解释:
: label lable for b and t commands
a \text apend text,
n N read/append the next line of input into the pattern space
$ match the last line
$! not to do it on the last line
b label branch to label, if label is omitted ,branch to end of script
s/regexp/replacement substitute command
/g globle replacement
; combine several sed commands on one line