I\'ve seen this syntax several places (eg, here):
xmllint --xpath \'/plist/array/string/text()\' tmp.xml
, used to query a particular XML node using an x
If you want to manipulate plist
files from the command line on a Mac, use PlistBuddy
.
For example, you can do this kind of thing in a shell script:
BUNDLE_ID=`/usr/libexec/PlistBuddy -c 'Print :CFBundleIdentifier' Info.plist`
echo $BUNDLE_ID
It's very powerful, you can add/delete items in arrays and dictionaries, look up keyed or indexed values, copy/merge/import other files, etc. See /usr/libexec/PlistBuddy -h
for full info.