我正在尝试将所有显示器与所有硬件链接到XML文件中。
我试图用所有这些信息创建一个XMLStarlet:
DataFund=$(xmlstarlet sel -T -t -m "hardwares/hardware" -n -v "concat(owner/name,',',owner/email,',',displays/display/name,',',displays/display/manufacturer,',',displays/display/description,',',id,',',name)" ~/Desktop/AllHardwares.csv)
但是我只有第一个显示来自我的xmlstarlet
XML文件(AllHardwares.csv)如下所示(我删除了所有者部分):
<hardwares>
<hardware>
<custom nil="true"/>
<href>988733.xml</href>
<id>988733</id>
<name>LEWK</name>
<ip>1333333</ip>
<category>
<id>2</id>
<name>Workstation</name>
</category>
<status>
<id>1</id>
<displays>
<display>
<name>HP</name>
<description>good</description>
</display>
<display>
<name>Compaq</name>
<description>bad</description>
</display>
</display>
<display>
<name>Apple</name>
<description>good</description>
</display>
</displays>
</status>
</hardware>
<hardware>
<custom nil="true"/>
<href>
988734.xml
</href>
<id>988734</id>
<name>LEWK1</name>
<ip>1333343</ip>
<category>
<id>24</id>
<name>Workstation</name>
</category>
<status>
<id>1</id>
<displays>
<display>
<name>HP4</name>
<description>good</description>
</display>
<display>
<name>Compaq4</name>
<description>bad</description>
</display>
</display>
<display>
<name>Apple4</name>
<description>good</description>
</display>
</displays>
</hardware>
</hardwares>
我需要返回以下信息:
本地IT默认监视器(标准监视器类型)默认 监控946805 SRV-MICROS
本地IT DELL P2311H通用非即插即用显示器948540 LESV101