更新时间:2023-12-05 22:10:22
sed '#n
1h;1!H
$ { x
:remtag
s#(
* *)*<([^>]*>)( *
*)*</2##g
t remtag
p
}' YourFile
(GNU sed 上的 posix 版本所以 --posix
)
(posix version so --posix
on GNU sed)
<tag1 prop="<tag2></tag2>">...
也将删除 prop 内容以及 xml 允许的任何其他内容.<tag1 prop="<tag2></tag2>"> ...
will remove the prop content also and any other thing like that that xml allow.