shell 如何刪除第二對 {}?
xxx{
{
{
xxx
}
}
}
shell 如何刪除xxx{{{xxx}}}中第二對 {}?
-
- 帖子: 1
- 注册时间: 2015-03-16 14:14
- 系统: debain
- astolia
- 论坛版主
- 帖子: 6703
- 注册时间: 2008-09-18 13:11
Re: shell 如何刪除xxx{{{xxx}}}中第二對 {}?
代码: 全选
$ echo 'xxx{
{
{
xxx
}
}
}
' | sed 'N;N;N;s/{\n{\n{\n/{\n{\n/g;s/}\n}\n}\n/}\n}\n/g'