How to find a string that is present in the file or not?

Im pretty new to shell scripting, but i have got the jist of it over the past 10 weeks or so i have been using it. I just have one thing im stuck on thats bugging the hell out of me. Here it goes...

I need a script that -
You enter a filename and then a string which reports whether that string is present or not?
So for example, i need to enter a filename such as "testfile1" then i need to enter a string such as "hey" and it will report back to me whether the string is in the file.

I've searched high and low for a script that actually works but to no avail :(. Any help will be greatly appreciated.

Thanks

This question means joining a few things together.

First off, the 'grep' utility does exactly what you want. It doesn't read from the user, but it does find strings in files.

grep -q string filename && echo "found in file"

Second, you can read a string from the user with the read shell built-in.

echo "Type a string and hit ENTER"
read VARIABLE 
echo "You typed $VARIABLE"

To make your script you can join these things together.

Have a read of the manual page for grep as a starting point. if you don't have them on your PI, there are on this site too, although there may be some variations. Look under the "Man Pages" link at the top of this page.

Robin
Liverpool/Blackburn
UK