xmllint unknown option '--xpath'

前端 未结 4 1750
夕颜
夕颜 2020-12-10 11:01

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

4条回答
  •  时光取名叫无心
    2020-12-10 11:20

    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.

提交回复
热议问题