【发布时间】:2013-02-15 12:59:52
【问题描述】:
我有一个运行工具的 shell 脚本。
我想要的是,这个shell脚本的退出代码应该写在.XMLfile中。
到目前为止我做了什么
# command1
# command2
echo "<status>" > /home/buser/ABC/status.xml // Writing into XML
cp2foss -f ABC -q all /srv/foss/$archive_file2 --user foss --password foss;
echo $? >> /home/buser/ABC/status.xml /// Wrting exit code into XML
echo "</status>" >> /home/buser/ABC/status.xml
它工作得很好,但我认为它不是一个好的 cosing 实践。
如何在 XML 文件中编写退出代码而不发生这种违规行为?
【问题讨论】:
-
如果您想进行代码审查,请考虑使用codereview.stackexchange.com