【发布时间】:2014-05-21 06:49:15
【问题描述】:
我尝试使用 sed 将文件中的多个空格替换为单个空格。
但它会像下面那样拆分每个字符。 请告诉我问题是什么...
$ cat test.txt
iiHi Hello Hi
this is loga
$
$ cat test.txt | tr [A-Z] [a-z]|sed -e "s/ */ /g"
i i h i h e l l o h i
t h i s i s l o g a
【问题讨论】: