Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否使用xmllint或其他解决方案修改特定节点?_Xml_Shell_Aix_Xmllint_Xmlstarlet - Fatal编程技术网

是否使用xmllint或其他解决方案修改特定节点?

是否使用xmllint或其他解决方案修改特定节点?,xml,shell,aix,xmllint,xmlstarlet,Xml,Shell,Aix,Xmllint,Xmlstarlet,我有这样一个xml文件: <!-- environnement totoserver --> <envs> <env> <id>1</id> <name>toto</name> <ip_server>1.1.1.1</ip_server> <state>on</state> </env> <env> <id&g

我有这样一个xml文件:

<!-- environnement totoserver -->
<envs>
 <env>
  <id>1</id>
  <name>toto</name>
  <ip_server>1.1.1.1</ip_server>
  <state>on</state>
 </env>
 <env>
  <id>2</id> [...]
 </env>

  <!-- environnement tata serveur -->
  <env>[...]
  </env>
  [...]
</envs>

1.
托托
1.1.1.1
在…上
2 [...]
[...]
[...]
为了找到特定节点的值,我使用xmllint。 有了这个,我尝试修改“toto”环境的状态值。 但是,我找不到正确的命令

那么,有人知道这样做的命令行吗

如果不可能,我怎么能做到?如果可能,不安装包装

非常感谢

使用

如果要将文件保存到位:

xmlstarlet ed --in-place -u ...

谢谢您的回答,但我的服务器中没有xmlstarlet。在软件包的现代版本中,命令的名称似乎是plain
xml
,而不是
xmlstarlet
。另外,非常有用。更正我之前的评论:原始命令名始终是
xml
AFAIK,但debian派生工具将其重命名为
xmlstarlet
xmlstarlet ed --in-place -u ...