How To Get Xml Tag Value In Shell Script?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To get the value of an XML tag in a shell script, you can use the grep command.
Example:
In this example, we are extracting the value of the “name“ tag from our test.xml file.
grep –oP ‘<name>\K.*?(?=</name>)’ test.xml
This will output the value of the name tag.