I\'m working on a script which deals with an xml file. I\'d like to update an attribute value in this xml file with xmlstarlet but it doesn\'t work.
Here is a sample
The proper way (will update settings on the fly)
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/default/XF86Display -s 'test'
This works for me (the root is <channel>
; attribute values quoted):
xmlstarlet edit \
--update "/channel[@name='xfce4-keyboard-shortcuts']/property[@name='commands']/property[@name='custom']/property[@name='XF86Display']/@value" \
--value "test" xfce4-keyboard-shortcuts.xml
Or simpler:
xmlstarlet edit \
--update "//property[@name='XF86Display']/@value" \
--value "test" xfce4-keyboard-shortcuts.xml