breaking for loop

Dear Friends,

Here I need your guidance once again.
I have for loop which check all files in a folder for a particular string. If the string is found in a file it returns value other than 0 else returns 0 value in variable t2.

At times the string which we are looking for is in first file only but since its a "for" loop it continues to check remaining files which unnecessarily consumes time and resources.

We want the "for" loop to stop searching further files once it gets the string in a particular file (I.e. it should stop executing further once the value in variable t2 is other than 0).

Please guide us.

Thank you
Anushree

Use break:

for file in *
do
    grep -q MY_string $file
    let t2=\!$?
    [ $t2 -gt 0 ] && break
done