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
This works for me (the root is
; 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