如何使用Shell脚本将整个XML存储到变量中

时间:2018-12-10 04:34:41

标签: shell unix

我有下面的XML文件,我只想使用Shell脚本将XML文件存储到变量中。

 <?xml version="1.0" encoding="UTF-8"?>
  <testng-results skipped="0" failed="0" total="10" passed="10">
    <test-method status="FAIL" is-config="true" duration-ms="4"
        started-at="2018-08-16T21:43:38Z" finished-at="2018-08-16T21:43:38Z">
        <params>
            <param index="0">
                <value>                <![CDATA[org.testng.TestRunner@31c2affc]]>
                </value>
            </param>
        </params>
        <reporter-output>
        </reporter-output>
     </test-method> <!-- setParameter -->
  </testng-results>

我想使用Shell脚本将此XML值分配给变量。有线索吗?

0 个答案:

没有答案
相关问题