Search
-
Recent Posts
Tags
adwords amazon analytics api apple aws blog chrome chromium cloud Design dropbox ec2 email error facebook firefox google google-apps homebrew ipad javascript jQuery linux lion mac microsoft mysql osx os x paypal php plugin quicksilver raspberry pi scam social spam twitter ubuntu unix video windows woo wordpress
Tag Archives: defaults
How can I use defaults write with a multi-line value? [solved]
I’m trying to use defaults write com.myprogram.plist “dataName” “dataValue” It works fine, but I have a long string that I need to set as the value: TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNl Y3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gTWFlY2VuYXMg dGluY2lkdW50LCBkaWFtIHNlZCBtb2xlc3RpZSBsYW9y ZWV0LA== How can I do this from the command line? Do I use an escape character like “\n” or can I just read a value from a file directly with defaults write ? Solution / Answer Use /usr/libexec/PlistBuddy instead, its Import <entry> <file> should do exactly what you want. In defaults, you could try to hex-encode your data and use the -data argument as type.