小编VRV*_*ara的帖子

使用 shell 脚本/命令编辑 xml 文件

我需要使用 unix 脚本或命令执行此操作 /home/user/app/xmlfiles 中有一个 xml 文件,例如

<book>
   <fiction type='a'>
      <author type=''></author>
   </fiction>
   <fiction type='b'>
      <author type=''></author>
   </fiction>
   <Romance>
       <author type=''></author>
   </Romance>
</book>
Run Code Online (Sandbox Code Playgroud)

我想将小说中的作者类型编辑为 local 。

   <fiction>
      <author type='Local'></author>
   </fiction>
Run Code Online (Sandbox Code Playgroud)

我需要单独使用属性 b更改小说标签中的作者类型。请使用 unix shell 脚本或命令帮助我解决这个问题。谢谢 !

unix bash shell shell-script bash-scripting

17
推荐指数
3
解决办法
7万
查看次数

标签 统计

bash ×1

bash-scripting ×1

shell ×1

shell-script ×1

unix ×1