I'm in the process of writing a bash script to automagically generate the openbox3 menu. Consider the following snippet:
Code:
# Start of menu
cat << EOF > ${MENUFILENAME}
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://openbox.org/
file:///usr/X11R6/share/openbox/menu.xsd">
EOF
echo "<menu id="root-menu" label=${MENUTITLE}>" >> ${MENUFILENAME}
I'm defining variables like so:
Code:
# Set var defaults
MENUFILENAME="${MENUFILENAME:=${HOME}/.config/openbox/menu.xml-autogen}"
MENUTITLE="${MENUTITLE:=openbox3}"
the output, which is written to the correct file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="http://openbox.org/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://openbox.org/
file:///usr/X11R6/share/openbox/menu.xsd">
<menu id=root-menu label=openbox3>
The problem -
openbox3's menu is in xml. I need the output to retain the double quote marks.
Desired format:
Code:
<menu id="root-menu" label="openbox3">
I'm sure (and hopeful) that the solution is simple, but it's eluding me. I thank anyone in advance for any input on how to echo the double quotes to the output file!