【发布时间】:2017-08-06 13:22:23
【问题描述】:
我正在尝试使用 XMLStarlet 工具在 bash 中使用脚本编辑我的 xml 文件。 所以我想删除我的文件的完整标签,我的问题在于我的命令语法如下:
xmlstarlet ed -d "/properties/structure name=\"preference\"" $1
标签是structure name="preference" >
我的错误是: XPath 错误:无效的表达式 /properties/structure" "name="preference" 错误指向第一个引号 (")
我尝试插入引号、反斜杠以使空格字符可以接受,但我找不到使它起作用的方法。 有人可以帮我解决这个问题吗?我还没有找到谈论这个的话题。
提前致谢
【问题讨论】:
-
能否提供完整的
XMLsn-p?
标签: xml bash shell space xmlstarlet