Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've got a .plist-file with a structure like this:

<plist version="1.0">
   <array>
      <dict>
         <key>BundleIsVersionChecked</key>
         <false/>
         <key>BundleIsRelocatable</key>
         <false/>
         <key>BundleHasStrictIdentifier</key>
         <false/>
         <key>RootRelativeBundlePath</key>
         <string>value</string>
      </dict>
   </array>
</plist>

I want to add or edit the RootRelativeBundlePath-key with the defaults write command. Another possibility would be writing the whole plist-file but it has to be the same exact structure.

How can I do this?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

defaults can run out of steam quickly on more complicated structures. When it does, you'll be glad to know of PlistBuddy(8), which hides outside of your PATH at /usr/libexec/PlistBuddy.

share|improve this answer
    
It seems to be impossible to generate a plist starting with an <array>-element instead of a <dict>-element by using the defaults-command. Therefore your answer is correct. –  Hedge Jun 20 '12 at 11:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.