在我在 XCode 中编译程序的脚本中,我需要将配置文件从
<string>${NAME}</string>
到<string>My New Name</string>
完成后,重做此更改。所以这条线工作:
cat $PLIST | sed "s/\${NAME}/${NEW_NAME}/" > $PLIST
--> Build my program
cat $PLIST | sed "s/${NEW_NAME}/\${NAME}/" > $PLIST
但是,有时我的文件$PLIST
是空的!我不知道为什么。这是文件保护吗?如何强制写入文件?