致力于Ubuntu中文推广http://forum.ubuntu.com.cn/
http://forum.ubuntu.com.cn/viewtopic.php?t=468853
代码: 全选
$ echo 'xxx{ { { xxx } } } ' | sed 'N;N;N;s/{\n{\n{\n/{\n{\n/g;s/}\n}\n}\n/}\n}\n/g'