As the title says, i'd like to find a string in a text, but the string is special. The text may like this:
{
PREBINDING = NO;
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "22B333C5-6D7A-4A76-81F2-12A045DAE44C";
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 2;
}
( Additionally, if you are a ios developer, you may know that the text example is from XXX.xcodeproj/project.pbxproj )
I need to find and delete this line of text:
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "22B333C5-6D7A-4A76-81F2-12A045DAE44C";
In this line, it has quotes("), has brackets([ ]), has star(*), also has space( ). When i try to find this line using code below:
provisionStr="22B333C5-6D7A-4A76-81F2-12A045DAE44C"
fileDir=project.pbxproj
totalLineStr=`grep $provisionStr $fileDir`
sed -i "" "s@$provisionStr@@" $fileDir
This bash code does not work. Please help me, i'm just beginning to learn to use bash.