sed如何快速处理ios工程文件的类json

现在有形如如下的类json

                            com.apple.ApplicationGroups.iOS = {
                                enabled = 0;
                            };    
                            com.apple.BackgroundModes = {
                                enabled = 1;
                            };    
                            com.apple.Push = {
                                enabled = 1;
                            };

如何把某一个enabled关掉呢?

sed -i "" "/com.apple.Push = {/,/}/{s/enabled = 1;/enabled = 0;/;}" file

 

Leave a Reply

Your email address will not be published.