i would like to parse the below xml text in bash script.
<os name="RedHat" os_version="6">
<package_manager type="name">rpm</package_manager>
<multipath_package_check type="command">rpm -qa | grep device-mapper-multipath</multipath_package_check>
<mpath_service_enable type="command">chkconfig multipathd on</mpath_service_enable>
<mpath_service_restart type="command">service multipathd restart</mpath_service_restart>
</os>
For example, i need to have functions like below to return the text if element attributes match the arguments.
get_package_manager "RedHat" "6"
should return "rpm"
get_multipath_package_check "RedHat" "6"
should return "rpm -qa | grep device-mapper-multipath"
appreciate any help.