使用XMLStarlet的bash脚本中引号之间的空格字符

使用XMLStarlet的bash脚本中引号之间的空格字符,xml,bash,shell,space,xmlstarlet,Xml,Bash,Shell,Space,Xmlstarlet,我正在尝试使用工具XMLStarlet在bash中使用脚本编辑xml文件。 因此,我想删除文件的完整标记,我的问题是命令的语法如下所示: xmlstarlet ed-d“/properties/structure name=\“preference\”“$1 标签是structure name=“preference”> 我的错误是: XPath错误:表达式无效 /属性/结构“name=”首选项 错误指向第一个引号(“”) 我尝试插入引号和反斜杠,以使空格字符可以接受,但我没有找到使其工作的方法

我正在尝试使用工具XMLStarlet在bash中使用脚本编辑xml文件。 因此,我想删除文件的完整标记,我的问题是命令的语法如下所示:

xmlstarlet ed-d“/properties/structure name=\“preference\”“$1

标签是structure name=“preference”>

我的错误是: XPath错误:表达式无效 /属性/结构“name=”首选项 错误指向第一个引号(“”)

我尝试插入引号和反斜杠,以使空格字符可以接受,但我没有找到使其工作的方法。 有人能在这个问题上帮助我吗?我还没有找到一个谈论这个的话题

提前感谢

来自:

<properties>
    <bla name="preference" >
    </bla>
    <structure name="preference" >
    </structure>
    <structure name="xxx" >
    </structure>
</properties>
产生

<?xml version="1.0"?>
<properties>
  <bla name="preference">
    </bla>
  <structure name="xxx">
    </structure>
</properties>

来自:

产生

<?xml version="1.0"?>
<properties>
  <bla name="preference">
    </bla>
  <structure name="xxx">
    </structure>
</properties>


能否完整提供
XML
代码段?能否完整提供
XML
代码段?