BASH SCRIPT - Change TRUE to FALSE for a Key in an Array -
i have basic knowledge of bash scripts nothing complex. i've been searching/testing days , can't results need...
i have info.plist located in: /dir1/dir2
in info.plist array: cfbundleurltypes
in array key: cfbundleurlisprivate
and key is: true
<key>cfbundleurltypes</key> <array> <dict> <key>cfbundleurlisprivate</key> <true/> </dict>
i want change value false testing hasn't worked. here's i've tried , if there's better way this, please let me know! tia
#!/bin/bash #access working directory cd /dir1/dir2 sed -i "/<key>cfbundleurlisprivate</{n;s/true/false/;}" info.plist
the sed
pattern should work fine, however, on os x (which i'll assume you're using) in-place edits have done different:
sed -i '' "/<key>cfbundleurlisprivate</{n;s/true/false/;}" info.plist
if don't include ''
you'll invalid command error.
Comments
Post a Comment