generate xml from a shell script

Hello!

I would like to generate an xml file from the output of various commands generated from within a shell script (some will be in CDATA).

At the moment the only solution I have come up with is echoing xml tags around the commands eg.

echo "<bitism>" >> outputfile 
/usr/sbin/prtconf -c >>outputfile
echo "</bitism>" >> outputfile

Have googled and searched the forums but would appreciate any recommendations for a better method.

---------------------------------------------
Maybe I should have posted this in the shell scripts forum
ok i'll repost it there as I can't work out how to delete this post
sorry admin!

from trawling deeper into the forums have found the following useful threads:-
CSV to XML (uses awk)

script to run shell command and insert results to existing xml file(uses sed)

:slight_smile: