Crop everything from the line that contain "I have a mac" to the end of the file and write the output to a new file:
sed -n '/I have a mac/,$ p' in-file > out-file
Remove everything from the line that contain "I have a mac" to the end of the file, make the changes in place of the file and create a backup copy of the original file:
sed '/I have a mac/,$ d' in-file -i.bak
Use a variable that contain the string that you are searching for and conditionally execute the above two commands:
SEARCH='I have a mac'
sed -n "/$SEARCH/,$ p" in-file > out-file && sed "/$SEARCH/,$ d" in-file -i.bak
Use grep to find (recursively) which file(s) contains the searched string and pass its name through pipe and xargs
to the above commands (reference):
export SEARCH='I have a mac'
grep -lr "$SEARCH" | xargs -L1 -I {} sh -c 'sed -n "/$SEARCH/,$ p" {} > {}.out && sed "/$SEARCH/,$ d" {} -i.bak'