So this is the full XML file:
<?xml version="1.0" encoding="UTF-8"?>
<ldap_users><size>1</size><ldap_user><uid>1396255</uid><uuid/><username>JSmith</username><realname>John Smith</realname><real_name>John Smith</real_name><email_address>[email protected]</email_address><phone/><phone_number/><building/><department/><room/><position/></ldap_user></ldap_users>
I am trying to only get the information for the "real_name" output into terminal when I run my script. Currently I have the script downloading the XML locally and then running xmllint like this:
sudo -u root xmllint --xpath 'string(//@real_name)' /Library/Application Support/JAMF/user.xml
But I am not getting anything in terminal. Can someone show me the right way if this is possible? If I am doing something wrong, what is the right way?
question from:
https://stackoverflow.com/questions/65893352/parse-specific-data-in-an-xml-file 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…