分页: 1 / 1

shell 如何刪除xxx{{{xxx}}}中第二對 {}?

发表于 : 2015-03-16 14:18
Yestare
shell 如何刪除第二對 {}?
xxx{
{
{
xxx
}
}
}

Re: shell 如何刪除xxx{{{xxx}}}中第二對 {}?

发表于 : 2015-03-19 10:41
astolia

代码: 全选

$ echo 'xxx{
{
{
xxx
}
}
}
' | sed 'N;N;N;s/{\n{\n{\n/{\n{\n/g;s/}\n}\n}\n/}\n}\n/g'