日期:2014-05-16  浏览次数:20601 次

使用shell编写xml文件
步骤:
1.在某个路径下生成xml文件
2.编写XML文件内容 


------解决方案--------------------
cat << END >/tmp/abc.xml
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">

<Worksheet ss:Name="xls1">

 <Table>
<Row>
<Cell><Data ss:Type="String">cell a1</Data></Cell>
<Cell><Data ss:Type="String">cell b2</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">cell a2</Data></Cell>
<Cell><Data ss:Type="String">cell b3</Data></Cell>
</Row>
 </Table>
</Worksheet>

</Workbook>
END