我已阅读此答案:https ://stackoverflow.com/a/7052168/6557127,但我的 XML 文件有点不同(openHAB REST API):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<items>
<item>
<type>GroupItem</type>
<name>All</name>
<state>baz</state>
<link>http://localhost:8080/rest/items/All</link>
</item>
<item>
<type>GroupItem</type>
<name>foo</name>
<state>bar</state>
<link>http://localhost:8080/rest/items/foo</link>
</item>
</items>
如何在 bash 中获取项目 foo 的状态?